[Cvs-annodex] commit (annodex): liboggz/trunk/src/liboggz/oggz_write.c liboggz/trunk/src/tests/Makefile.am liboggz/trunk/src/tests/write-prefix.c

conrad nobody at lists.annodex.net
Tue Jun 20 21:59:14 UTC 2006


Update of /var/local/lib/svn/annodex (new revision 2340)

Modified files:
   liboggz/trunk/src/liboggz/oggz_write.c
   liboggz/trunk/src/tests/Makefile.am
   liboggz/trunk/src/tests/write-prefix.c

Log Message:
bugfix: remove memory leak in oggz_write when closing a stream early (before
writing the next packet, when it has already been dequeued) -- detected by
valgrind on write-suffix test, and similar write-prefix test


Modified: liboggz/trunk/src/liboggz/oggz_write.c
===================================================================
--- liboggz/trunk/src/liboggz/oggz_write.c	2006-06-19 06:08:03 UTC (rev 2339)
+++ liboggz/trunk/src/liboggz/oggz_write.c	2006-06-20 21:59:14 UTC (rev 2340)
@@ -163,6 +163,9 @@
 
   oggz_write_flush (oggz);
 
+  oggz_writer_packet_free (writer->current_zpacket);
+  oggz_writer_packet_free (writer->next_zpacket);
+
   oggz_vector_foreach (writer->packet_queue,
 		       (OggzFunc)oggz_writer_packet_free);
   oggz_vector_delete (writer->packet_queue);

Modified: liboggz/trunk/src/tests/Makefile.am
===================================================================
--- liboggz/trunk/src/tests/Makefile.am	2006-06-19 06:08:03 UTC (rev 2339)
+++ liboggz/trunk/src/tests/Makefile.am	2006-06-20 21:59:14 UTC (rev 2340)
@@ -67,7 +67,7 @@
 write_bad_packetno_SOURCES = write-bad-packetno.c
 write_bad_packetno_LDADD = $(OGGZ_LIBS)
 
-write_prefix_SOURCES = write-suffix.c
+write_prefix_SOURCES = write-prefix.c
 write_prefix_LDADD = $(OGGZ_LIBS)
 write_suffix_SOURCES = write-suffix.c
 write_suffix_LDADD = $(OGGZ_LIBS)

Modified: liboggz/trunk/src/tests/write-prefix.c
===================================================================
--- liboggz/trunk/src/tests/write-prefix.c	2006-06-19 06:08:03 UTC (rev 2339)
+++ liboggz/trunk/src/tests/write-prefix.c	2006-06-20 21:59:14 UTC (rev 2340)
@@ -55,7 +55,7 @@
 
   switch (packetno) {
   case 0:
-    INFO ("Feeding stream suffix");
+    INFO ("Feeding stream prefix");
     op.b_o_s = 1;
     op.e_o_s = 0;
     serialno = serialno1;
@@ -84,7 +84,7 @@
   
   err = oggz_write_feed (oggz, &op, serialno, 0, NULL);
   if (err != 0) {
-    printf ("Error %d\n", err);
+    printf ("Error %ld\n", err);
     FAIL ("Could not feed OGGZ");
 #if 0
     switch (err) {


-- 
conrad



More information about the cvs-annodex mailing list