diff options
author | jstebbins <[email protected]> | 2012-09-13 20:13:59 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2012-09-13 20:13:59 +0000 |
commit | 8329bf01460521587889fd4133f76b32ccf13217 (patch) | |
tree | c0758b2c843c05b03ab1ad93857c6045ad7c0a91 /libhb/fifo.c | |
parent | ae8dee43bbcd12b5a4a532c7f4f65bf912479428 (diff) |
libhb: fix a collection of small memory leaks
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4963 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/fifo.c')
-rw-r--r-- | libhb/fifo.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |