[xiph-commits] r13165 - branches/lowmem-branch/Tremor

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu Jun 21 16:18:01 PDT 2007


Author: xiphmont
Date: 2007-06-21 16:18:01 -0700 (Thu, 21 Jun 2007)
New Revision: 13165

Modified:
   branches/lowmem-branch/Tremor/Makefile.am
   branches/lowmem-branch/Tremor/framing.c
Log:
Eliminate memory leak bugs in Tremor-lowmem (closes bug 1127)
Eliminate electric fence from debug Makefile; valgrind supercedes.



Modified: branches/lowmem-branch/Tremor/Makefile.am
===================================================================
--- branches/lowmem-branch/Tremor/Makefile.am	2007-06-21 23:07:33 UTC (rev 13164)
+++ branches/lowmem-branch/Tremor/Makefile.am	2007-06-21 23:18:01 UTC (rev 13165)
@@ -31,7 +31,7 @@
 	$(MAKE) ivorbisfile_example
 
 debug:
-	$(MAKE) all CFLAGS="@DEBUG@" LDFLAGS="-lefence"	
+	$(MAKE) all CFLAGS="@DEBUG@"
 
 profile:
 	$(MAKE) all CFLAGS="@PROFILE@"

Modified: branches/lowmem-branch/Tremor/framing.c
===================================================================
--- branches/lowmem-branch/Tremor/framing.c	2007-06-21 23:07:33 UTC (rev 13164)
+++ branches/lowmem-branch/Tremor/framing.c	2007-06-21 23:18:01 UTC (rev 13165)
@@ -53,11 +53,6 @@
     bt=bs->unused_buffers;
     rt=bs->unused_references;
 
-    if(!bs->outstanding){
-      _ogg_free(bs);
-      return;
-    }
-
     while(bt){
       ogg_buffer *b=bt;
       bt=b->ptr.next;
@@ -71,6 +66,10 @@
       _ogg_free(r);
     }
     bs->unused_references=0;
+
+    if(!bs->outstanding)
+      _ogg_free(bs);
+
   }
 }
 
@@ -825,6 +824,7 @@
     ogg_buffer_release(os->header_tail);
     ogg_buffer_release(os->body_tail);
     memset(os,0,sizeof(*os));    
+    _ogg_free(os);
   }
   return OGG_SUCCESS;
 } 



More information about the commits mailing list