From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/heap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 16abc158e55..7697b8f0354 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -1337,8 +1337,9 @@ static void heap_set_debug_flags( HANDLE handle ) if (block_get_flags( block ) & BLOCK_FLAG_FREE) { char *data = (char *)block + block_get_overhead( block ), *end = (char *)block + block_get_size( block ); - if (end >= commit_end) mark_block_free( data, commit_end - data, flags ); - else mark_block_free( data, end - sizeof(struct block *) - data, flags ); + if (next_block( subheap, block )) end -= sizeof(struct block *); + if (end > commit_end) mark_block_free( data, commit_end - data, flags ); + else mark_block_free( data, end - data, flags ); } else {