mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
ntdll: Give earlier notify to valgrind that HeapFree is trying to free some memory.
This commit is contained in:
parent
bd58463eda
commit
a9a852faa9
@ -1280,8 +1280,10 @@ BOOLEAN WINAPI RtlFreeHeap( HANDLE heap, ULONG flags, PVOID ptr )
|
||||
flags |= heapPtr->flags;
|
||||
if (!(flags & HEAP_NO_SERIALIZE)) RtlEnterCriticalSection( &heapPtr->critSection );
|
||||
|
||||
/* Some sanity checks */
|
||||
/* Inform valgrind we are trying to free memory, so it can throw up an error message */
|
||||
notify_free( ptr );
|
||||
|
||||
/* Some sanity checks */
|
||||
pInUse = (ARENA_INUSE *)ptr - 1;
|
||||
if (!(subheap = HEAP_FindSubHeap( heapPtr, pInUse ))) goto error;
|
||||
if ((char *)pInUse < (char *)subheap->base + subheap->headerSize) goto error;
|
||||
@ -1289,8 +1291,6 @@ BOOLEAN WINAPI RtlFreeHeap( HANDLE heap, ULONG flags, PVOID ptr )
|
||||
|
||||
/* Turn the block into a free block */
|
||||
|
||||
notify_free( ptr );
|
||||
|
||||
HEAP_MakeInUseBlockFree( subheap, pInUse );
|
||||
|
||||
if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveCriticalSection( &heapPtr->critSection );
|
||||
|
Loading…
Reference in New Issue
Block a user