Commit 8cebbe66 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix block leak in block_Realloc corner case (CID 78)

block_Realloc() is a lot more intelligent in 0.9.0 nowadays, but I would
rather not commit large changes to -bugfix...
parent fca556b4
......@@ -99,7 +99,11 @@ block_t *block_Realloc( block_t *p_block, int i_prebody, int i_body )
i_buffer_size = i_prebody + i_body;
if( i_body < 0 || i_buffer_size <= 0 ) return NULL;
if( i_body < 0 || i_buffer_size <= 0 )
{
block_Release( p_block );
return NULL;
}
if( p_block->p_buffer - i_prebody > p_block->p_sys->p_allocated_buffer &&
p_block->p_buffer - i_prebody < p_block->p_sys->p_allocated_buffer +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment