From d389c4bad45357fbd07b8b7d309280215617c0b6 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Fri, 5 Jul 2002 00:18:08 +0000 Subject: [PATCH] MSVCRT_operator_new: Call handler only when "new" operation fails. --- dlls/msvcrt/heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msvcrt/heap.c b/dlls/msvcrt/heap.c index 0c6d36d7750..2a5cbbf7171 100644 --- a/dlls/msvcrt/heap.c +++ b/dlls/msvcrt/heap.c @@ -50,7 +50,7 @@ void* MSVCRT_operator_new(unsigned long size) void *retval = HeapAlloc(GetProcessHeap(), 0, size); TRACE("(%ld) returning %p\n", size, retval); LOCK_HEAP; - if(retval && MSVCRT_new_handler) + if(!retval && MSVCRT_new_handler) (*MSVCRT_new_handler)(size); UNLOCK_HEAP; return retval;