From 25d7084df05fd181bc0cdda69c6172393950dd90 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 21 Dec 2022 00:31:38 +0000 Subject: __ntapi_tt_fork(): never leak the hresumed event handle. --- src/process/ntapi_tt_fork.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/process') diff --git a/src/process/ntapi_tt_fork.c b/src/process/ntapi_tt_fork.c index 20c7c25..b7a7a20 100644 --- a/src/process/ntapi_tt_fork.c +++ b/src/process/ntapi_tt_fork.c @@ -301,11 +301,15 @@ int32_t __fastcall __ntapi_tt_fork( NT_EVENT_NOT_SIGNALED))) return status; - if ((status = __ntapi->tt_create_inheritable_event( - &hready, - NT_NOTIFICATION_EVENT, - NT_EVENT_NOT_SIGNALED))) + status = __ntapi->tt_create_inheritable_event( + &hready, + NT_NOTIFICATION_EVENT, + NT_EVENT_NOT_SIGNALED); + + if (status) { + __ntapi->zw_close(hresumed); return status; + } for (i=0; i<32; i++) { if (__ntapi->zw_create_user_process) -- cgit v1.2.3