summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <xiphmont@xiph.org>2007-06-21 23:07:33 +0000
committerMonty <xiphmont@xiph.org>2007-06-21 23:07:33 +0000
commitb81b3e2e214c079298527d5da7e4462805a5bc45 (patch)
tree47771e49ed6d2fbff0071c555b399e4dc4cc33fc
parent6b97cd6d160107ce8c2493ee9318b1e463e6f637 (diff)
downloadtremor-b81b3e2e214c079298527d5da7e4462805a5bc45.tar.gz
Eliminate memory leak bugs in Tremor mailine (closes bug 1127)
Eliminate electric fence from debug Makefile; valgrind supercedes. git-svn-id: https://svn.xiph.org/trunk/Tremor@13164 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 f7b19e8..d14081f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,7 +32,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 48ea6c1..55bddc1 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);
+
}
}
@@ -834,6 +833,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;
}