Commit 74e0c4ce authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Mind LFH pending blocks in RtlDestroyHeap().

parent 1aa6a900
......@@ -326,6 +326,8 @@ C_ASSERT( offsetof(struct heap, subheap) <= REGION_ALIGN - 1 );
static struct heap *process_heap; /* main process heap */
static NTSTATUS heap_free_block_lfh( struct heap *heap, ULONG flags, struct block *block );
/* check if memory range a contains memory range b */
static inline BOOL contains( const void *a, SIZE_T a_size, const void *b, SIZE_T b_size )
{
......@@ -1640,7 +1642,10 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE handle )
{
heap->pending_free = NULL;
for (tmp = pending; *tmp && tmp != pending + MAX_FREE_PENDING; ++tmp)
{
if (!heap_free_block_lfh( heap, heap->flags, *tmp )) continue;
heap_free_block( heap, heap->flags, *tmp );
}
RtlFreeHeap( handle, 0, pending );
}
......
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