From c0913ed064f86d9cc2ddf6efc7f6f6a9db446934 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 28 Feb 2011 11:39:57 +0100 Subject: [PATCH] ntdll: Fix race condition in RtlCreateHeap(). --- dlls/ntdll/heap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index df944100f56..2e945e96c5c 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -1538,6 +1538,8 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c if (!(subheap = HEAP_CreateSubHeap( NULL, addr, flags, commitSize, totalSize ))) return 0; + heap_set_debug_flags( subheap->heap ); + /* link it into the per-process heap list */ if (processHeap) { @@ -1552,7 +1554,6 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c list_init( &processHeap->entry ); } - heap_set_debug_flags( subheap->heap ); return subheap->heap; }