realloc: Set the HEAP when splitting a block
authorMatt Fleming <matt.fleming@intel.com>
Wed, 23 Jan 2013 10:55:14 +0000 (10:55 +0000)
committerMatt Fleming <matt.fleming@intel.com>
Wed, 23 Jan 2013 15:05:28 +0000 (15:05 +0000)
commit8bd57b191035bf02b676e2fa760d3a981bd1df02
tree3505cc137520e10a9f719d1ad6eb0f8e0678d62b
parentfdb7da7c2a868ab4537d020584c03f128e511d8d
realloc: Set the HEAP when splitting a block

Failure to do so means we may put a free block in some random location
because ARENA_HEAP_GET() can return something invalid when used to
find the correct free list in __free_block().

This bug manifested as running out of available free memory.

Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
core/mem/malloc.c