Package: ripole
Version: 0.2.0-1
Followup-For: Bug #435810

The problem is related to freeing memory.

Here is a little patch.
Common subdirectories: ripole-0.2.0/debian and ripole-0.2.0-new/debian
diff -U 8 -p ripole-0.2.0/ripole.c ripole-0.2.0-new/ripole.c
--- ripole-0.2.0/ripole.c	2005-12-12 04:06:21.000000000 +0100
+++ ripole-0.2.0-new/ripole.c	2007-09-17 21:24:38.000000000 +0200
@@ -38,17 +38,17 @@ static char help[]="ripOLE -i <OLE2 file
 Comments:
 
 --------------------------------------------------------------------
 Changes:
 
 \------------------------------------------------------------------*/
 int ROLE_set_defaults( struct ripOLE_object *role )
 {
-	role->outputdir = defaultdir;
+	role->outputdir = strdup(defaultdir);
 	role->debug = 0;
 	role->verbose = 0;
 	role->save_unknown_streams = 0;
 	role->inputfile = NULL;
 
 	return 0;
 }
 
@@ -69,31 +69,30 @@ Comments:
 Changes:
 
 \------------------------------------------------------------------*/
 int ROLE_parse_parameters( struct ripOLE_object *role, int argc, char **argv )
 {
 	int i;
 	int result = 0;
 
-	role->outputdir = defaultdir;
-
 	for (i = 1; i < argc; i++)
 	{
 		if (argv[i][0] == '-')
 		{
 			switch (argv[i][1])
 			{
 				case 'i':
 					i++;
 					role->inputfile = strdup(argv[i]);
 					break;
 
 				case 'd':
 					i++;
+					free(role->outputdir);
 					role->outputdir = strdup(argv[i]);
 					break;
 
 				case 'v':
 					role->verbose = 1;
 					break;
 
 				case 'V':

Reply via email to