ntdll: Mask block flags when computing HEAP_InsertFreeBlock size.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2022-05-03 18:31:28 +02:00 committed by Alexandre Julliard
parent 0416d2f167
commit ba21d8fd54
1 changed files with 2 additions and 1 deletions

View File

@ -586,7 +586,8 @@ static HEAP *HEAP_GetPtr(
*/
static inline void HEAP_InsertFreeBlock( HEAP *heap, ARENA_FREE *pArena, BOOL last )
{
FREE_LIST_ENTRY *pEntry = heap->freeList + get_freelist_index( pArena->size + sizeof(*pArena) );
SIZE_T block_size = (pArena->size & ARENA_SIZE_MASK) + sizeof(*pArena);
FREE_LIST_ENTRY *pEntry = heap->freeList + get_freelist_index( block_size );
if (last)
{
/* insert at end of free list, i.e. before the next free list entry */