From 8329bf01460521587889fd4133f76b32ccf13217 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Thu, 13 Sep 2012 20:13:59 +0000 Subject: libhb: fix a collection of small memory leaks git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4963 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/fifo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libhb/fifo.c') diff --git a/libhb/fifo.c b/libhb/fifo.c index 1f0d2ef97..6d11551f9 100644 --- a/libhb/fifo.c +++ b/libhb/fifo.c @@ -239,9 +239,9 @@ void hb_buffer_pool_free( void ) count = 0; while( ( b = hb_fifo_get(buffers.pool[i]) ) ) { - freed += b->alloc; if( b->data ) { + freed += b->alloc; free( b->data ); } free( b ); @@ -342,7 +342,7 @@ void hb_buffer_realloc( hb_buffer_t * b, int size ) { if ( size > b->alloc || b->data == NULL ) { - uint32_t orig = b->alloc; + uint32_t orig = b->data != NULL ? b->alloc : 0; size = size_to_pool( size )->buffer_size; b->data = realloc( b->data, size ); b->alloc = size; -- cgit v1.2.3