msvcrt: Pass on the return value in _callnewh.
Also try to avoid race conditions by storing the new handler in a local variable before checking whether it's non-null. Signed-off-by: Martin Storsjo <martin@martin.st> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
eb5f7531ac
commit
e66758dd53
|
@ -234,9 +234,11 @@ int CDECL MSVCRT__set_new_mode(int mode)
|
|||
*/
|
||||
int CDECL _callnewh(MSVCRT_size_t size)
|
||||
{
|
||||
if(MSVCRT_new_handler)
|
||||
(*MSVCRT_new_handler)(size);
|
||||
return 0;
|
||||
int ret = 0;
|
||||
MSVCRT_new_handler_func handler = MSVCRT_new_handler;
|
||||
if(handler)
|
||||
ret = (*handler)(size) ? 1 : 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
Loading…
Reference in New Issue