[xiph-commits] r18449 - trunk/vorbis-tools/oggdec

giles at svn.xiph.org giles at svn.xiph.org
Thu Jul 12 14:23:06 PDT 2012


Author: giles
Date: 2012-07-12 14:23:06 -0700 (Thu, 12 Jul 2012)
New Revision: 18449

Modified:
   trunk/vorbis-tools/oggdec/oggdec.c
Log:
Fix two leaks of the output filename.

This isn't all of them, by any stretch, but they are
the ones which were easy to trigger when the output
file could not be opened. Helps with valgrind cleanness.


Modified: trunk/vorbis-tools/oggdec/oggdec.c
===================================================================
--- trunk/vorbis-tools/oggdec/oggdec.c	2012-07-12 19:27:51 UTC (rev 18448)
+++ trunk/vorbis-tools/oggdec/oggdec.c	2012-07-12 21:23:06 UTC (rev 18449)
@@ -403,6 +403,7 @@
 
             if(!infile) {
                 fclose(outfile);
+                free(outfilename);
                 return 1;
             }
             if(decode_file(infile, outfile, infilename, outfilename)) {
@@ -444,8 +445,11 @@
             }
 
             infile = open_input(in);
-            if(!infile)
+            if(!infile) {
+                if(outfilename)
+                    free(outfilename);
                 return 1;
+            }
             outfile = open_output(out);
             if(!outfile) {
                 fclose(infile);



More information about the commits mailing list