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

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


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

Modified:
   liboggz/trunk/src/tools/skeleton.c
   liboggz/trunk/src/tools/skeleton.h
Log:
add fisbone_clear() function, for deallocating message headers in a fisbone.
This patch can be used more generally in code using skeleton.[ch] for
avoiding memory leaks where message headers are read. Patch by ogg.k.ogg.k


Modified: liboggz/trunk/src/tools/skeleton.c
===================================================================
--- liboggz/trunk/src/tools/skeleton.c	2008-05-25 07:30:08 UTC (rev 3602)
+++ liboggz/trunk/src/tools/skeleton.c	2008-06-02 10:07:00 UTC (rev 3603)
@@ -214,6 +214,13 @@
     return 0;
 }
 
+int fisbone_clear(fisbone_packet *fp)
+{
+    if (!fp) return -1;
+    _ogg_free(fp->message_header_fields);
+    return 0;
+}
+
 int add_fishead_to_stream(ogg_stream_state *os, fishead_packet *fp) {
 
     ogg_packet op;

Modified: liboggz/trunk/src/tools/skeleton.h
===================================================================
--- liboggz/trunk/src/tools/skeleton.h	2008-05-25 07:30:08 UTC (rev 3602)
+++ liboggz/trunk/src/tools/skeleton.h	2008-06-02 10:07:00 UTC (rev 3603)
@@ -54,6 +54,7 @@
 /* remember to deallocate the returned ogg_packet properly */
 extern int ogg_from_fishead(fishead_packet *fp,ogg_packet *op);
 extern int ogg_from_fisbone(fisbone_packet *fp,ogg_packet *op);
+extern int fisbone_clear(fisbone_packet *fp);
 extern int fishead_from_ogg(ogg_packet *op,fishead_packet *fp);
 extern int fisbone_from_ogg(ogg_packet *op,fisbone_packet *fp);
 extern int add_fishead_to_stream(ogg_stream_state *os, fishead_packet *fp);



More information about the commits mailing list