summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <xiphmont@xiph.org>2007-06-21 23:18:01 +0000
committerMonty <xiphmont@xiph.org>2007-06-21 23:18:01 +0000
commit384501d0db88969235abd1a7e550a1cf0ecd268c (patch)
treefec58c497b244b33ef02701fd9eabebee4cac262
parente50e19f9a07d2e0b06fd93b65038e304022f0f49 (diff)
downloadtremor-384501d0db88969235abd1a7e550a1cf0ecd268c.tar.gz
Eliminate memory leak bugs in Tremor-lowmem (closes bug 1127)
Eliminate electric fence from debug Makefile; valgrind supercedes. git-svn-id: https://svn.xiph.org/branches/lowmem-branch/Tremor@13165 0101bb08-14d6-0310-b084-bc0e0c8e3800
-rw-r--r--Makefile.am2
-rw-r--r--framing.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am
index b92afa8..81fbdc4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,7 +31,7 @@ example:
$(MAKE) ivorbisfile_example
debug:
- $(MAKE) all CFLAGS="@DEBUG@" LDFLAGS="-lefence"
+ $(MAKE) all CFLAGS="@DEBUG@"
profile:
$(MAKE) all CFLAGS="@PROFILE@"
diff --git a/framing.c b/framing.c
index f1194a3..4842143 100644
--- a/framing.c
+++ b/framing.c
@@ -53,11 +53,6 @@ static void _ogg_buffer_destroy(ogg_buffer_state *bs){
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 @@ static void _ogg_buffer_destroy(ogg_buffer_state *bs){
_ogg_free(r);
}
bs->unused_references=0;
+
+ if(!bs->outstanding)
+ _ogg_free(bs);
+
}
}
@@ -825,6 +824,7 @@ int ogg_stream_destroy(ogg_stream_state *os){
ogg_buffer_release(os->header_tail);
ogg_buffer_release(os->body_tail);
memset(os,0,sizeof(*os));
+ _ogg_free(os);
}
return OGG_SUCCESS;
}