[xiph-commits] r3604 - liboggz/trunk/src/tools

conrad at svn.annodex.net conrad at svn.annodex.net
Mon Jun 2 03:07:14 PDT 2008


Author: conrad
Date: 2008-06-02 03:07:14 -0700 (Mon, 02 Jun 2008)
New Revision: 3604

Modified:
   liboggz/trunk/src/tools/oggzinfo.c
Log:
oggzinfo: remove memory leak from allocated message headers
Patch by ogg.k.ogg.k


Modified: liboggz/trunk/src/tools/oggzinfo.c
===================================================================
--- liboggz/trunk/src/tools/oggzinfo.c	2008-06-02 10:07:00 UTC (rev 3603)
+++ liboggz/trunk/src/tools/oggzinfo.c	2008-06-02 10:07:14 UTC (rev 3604)
@@ -220,7 +220,7 @@
 static void
 ot_fisbone_print(OI_Info * info, OI_TrackInfo *oit) {
 
-  char *messages, *token;
+  char *allocated, *messages, *token;
   
   if (oit->has_fisbone) {
     printf("\n\tExtra information from Ogg Skeleton track:\n");
@@ -232,7 +232,7 @@
     ot_fprint_granulepos(stdout, info->oggz, oit->fbInfo.serial_no, oit->fbInfo.start_granule);
     printf ("\n");
     printf("\tPreroll: %d\n", oit->fbInfo.preroll);
-    messages = token = _ogg_calloc(oit->fbInfo.current_header_size+1, sizeof(char));
+    allocated = messages = _ogg_calloc(oit->fbInfo.current_header_size+1, sizeof(char));
     strcpy(messages, oit->fbInfo.message_header_fields);
     printf("\tMessage Header Fields:\n");
     while (1) {
@@ -242,6 +242,7 @@
 	break;
     }
     printf("\n");
+    _ogg_free(allocated);
   }
 }
 
@@ -408,6 +409,7 @@
     else {
       fprintf(stderr, "Warning: logical stream %08x referenced by skeleton was not found\n",fp.serial_no);
     }
+    fisbone_clear(&fp);
   } else if (!op->e_o_s && !memcmp(op->packet, FISHEAD_IDENTIFIER, 8)) {
     fishead_packet fp;
     int ret = fishead_from_ogg(op, &fp);



More information about the commits mailing list