From: Dan F. <dfa...@us...> - 2009-12-11 08:09:42
|
Update of /cvsroot/libexif/exif/exif In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26346/exif Modified Files: actions.c actions.h main.c Log Message: Fixed a couple of memory leaks Index: main.c =================================================================== RCS file: /cvsroot/libexif/exif/exif/main.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -p -d -r1.79 -r1.80 --- main.c 24 Nov 2009 04:52:11 -0000 1.79 +++ main.c 11 Dec 2009 08:09:29 -0000 1.80 @@ -178,8 +178,8 @@ static unsigned int extract_thumbnail = static unsigned int remove_tag = 0, create_exif = 0, no_fixup = 0; static unsigned int list_mnote = 0; static unsigned int show_version = 0; -static const char *output = NULL; -static const char *ifd_string = NULL, *tag_string = NULL; +static char *output = NULL; +static char *ifd_string = NULL, *tag_string = NULL; static ExifParams p = {EXIF_INVALID_TAG, EXIF_IFD_COUNT, 0, 0, 80, NULL, NULL,NULL}; LogArg log_arg = {0, 0, 0}; @@ -434,6 +434,13 @@ main (int argc, const char **argv) args++; } + /* Free all libpopt string arguments */ + free(tag_string); + free(ifd_string); + free(p.set_thumb); + free(output); + free(p.set_value); + exif_log_free (log); poptFreeContext (ctx); Index: actions.c =================================================================== RCS file: /cvsroot/libexif/exif/exif/actions.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -p -d -r1.53 -r1.54 --- actions.c 24 Nov 2009 04:52:11 -0000 1.53 +++ actions.c 11 Dec 2009 08:09:29 -0000 1.54 @@ -225,6 +225,8 @@ action_create_value (ExifData *ed, ExifL e = exif_entry_new (); exif_content_add_entry (ed->ifd[ifd], e); exif_entry_initialize (e, tag); + /* The entry has been added to the IFD, so we can unref it */ + exif_entry_unref(e); } return e; } Index: actions.h =================================================================== RCS file: /cvsroot/libexif/exif/exif/actions.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -p -d -r1.13 -r1.14 --- actions.h 27 Oct 2009 06:09:44 -0000 1.13 +++ actions.h 11 Dec 2009 08:09:29 -0000 1.14 @@ -33,8 +33,8 @@ typedef struct { const char *fin; - const char *set_value; - const char *set_thumb; + char *set_value; + char *set_thumb; } ExifParams; void action_insert_thumb (ExifData *, ExifLog *, ExifParams); |