[xiph-cvs] cvs commit: vorbis-tools/vorbiscomment vcedit.c vcomment.c

Michael Smith msmith at xiph.org
Sat Mar 30 06:41:02 PST 2002



msmith      02/03/30 06:41:01

  Modified:    vorbiscomment vcedit.c vcomment.c
  Log:
  More memory leak fixes.

Revision  Changes    Path
1.18      +2 -1      vorbis-tools/vorbiscomment/vcedit.c

Index: vcedit.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/vorbiscomment/vcedit.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- vcedit.c	2002/01/26 11:06:43	1.17
+++ vcedit.c	2002/03/30 14:40:59	1.18
@@ -6,7 +6,7 @@
  *
  * Comment editing backend, suitable for use by nice frontend interfaces.
  *
- * last modified: $Id: vcedit.c,v 1.17 2002/01/26 11:06:43 segher Exp $
+ * last modified: $Id: vcedit.c,v 1.18 2002/03/30 14:40:59 msmith Exp $
  */
 
 #include <stdio.h>
@@ -124,6 +124,7 @@
         op->e_o_s=0;
         op->granulepos=0;
 
+	oggpack_writeclear(&opb);
         return 0;
 }
 

<p><p>1.24      +12 -0     vorbis-tools/vorbiscomment/vcomment.c

Index: vcomment.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/vorbiscomment/vcomment.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- vcomment.c	2002/03/15 08:37:15	1.23
+++ vcomment.c	2002/03/30 14:40:59	1.24
@@ -55,6 +55,7 @@
 int  add_comment(char *line, vorbis_comment *vc, int raw);
 
 param_t	*new_param(void);
+void free_param(param_t *param);
 void parse_options(int argc, char *argv[], param_t *param);
 void open_files(param_t *p);
 void close_files(param_t *p);
@@ -101,6 +102,7 @@
                 {
                         fprintf(stderr, _("Failed to open file as vorbis: %s\n"), 
                                         vcedit_error(state));
+            free_param(param);
                         return 1;
                 }
 
@@ -112,6 +114,7 @@
                 vcedit_clear(state);
 
                 close_files(param);
+        free_param(param);
                 return 0;		
         }
 
@@ -123,6 +126,7 @@
                 {
                         fprintf(stderr, _("Failed to open file as vorbis: %s\n"), 
                                         vcedit_error(state));
+            free_param(param);
                         return 1;
                 }
 
@@ -161,6 +165,7 @@
                 {
                         fprintf(stderr, _("Failed to write comments to output file: %s\n"), 
                                         vcedit_error(state));
+            free_param(param);
                         return 1;
                 }
 
@@ -168,11 +173,13 @@
                 vcedit_clear(state);
                 
                 close_files(param);
+        free_param(param);
                 return 0;
         }
 
         /* should never reach this point */
         fprintf(stderr, _("no action specified\n"));
+    free_param(param);
         return 1;
 }
 
@@ -298,6 +305,11 @@
         ); 
 }
 
+void free_param(param_t *param) {
+    free(param->infilename);
+    free(param->outfilename);
+    free(param);
+}
 
 /**********
 

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list