From 9c519f2fba13f27895dc097fc67ad3f17fbd2258 Mon Sep 17 00:00:00 2001 From: Conrad Parker Date: Thu, 19 Aug 2004 02:06:02 +0000 Subject: free memory allocated in testing routines, to allow checks to pass in leak-checking environments git-svn-id: http://svn.xiph.org/trunk/ogg@7586 0101bb08-14d6-0310-b084-bc0e0c8e3800 --- src/bitwise.c | 2 ++ src/framing.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) (limited to 'src') diff --git a/src/bitwise.c b/src/bitwise.c index cfceddc..deab67e 100644 --- a/src/bitwise.c +++ b/src/bitwise.c @@ -687,6 +687,7 @@ int main(void){ fprintf(stderr,"failed; read past end without -1.\n"); exit(1); } + oggpack_writeclear(&o); fprintf(stderr,"ok.\n"); /********** lazy, cut-n-paste retest with MSb packing ***********/ @@ -772,6 +773,7 @@ int main(void){ fprintf(stderr,"failed; read past end without -1.\n"); exit(1); } + oggpackB_writeclear(&o); fprintf(stderr,"ok.\n\n"); diff --git a/src/framing.c b/src/framing.c index 69adb86..c8cf2c9 100644 --- a/src/framing.c +++ b/src/framing.c @@ -1002,6 +1002,11 @@ void copy_page(ogg_page *og){ og->body=temp; } +void free_page(ogg_page *og){ + _ogg_free (og->header); + _ogg_free (og->body); +} + void error(void){ fprintf(stderr,"error!\n"); exit(1); @@ -1734,6 +1739,13 @@ int main(void){ fprintf(stderr,"ok.\n"); } + + /* Free page data that was previously copied */ + { + for(i=0;i<5;i++){ + free_page(&og[i]); + } + } } return(0); -- cgit v1.2.1