MSVCRT_operator_new: Call handler only when "new" operation fails.

This commit is contained in:
Uwe Bonnes 2002-07-05 00:18:08 +00:00 committed by Alexandre Julliard
parent 1cef2974ab
commit d389c4bad4

View file

@ -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;