summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2022-12-21 00:31:38 +0000
committermidipix <writeonce@midipix.org>2022-12-21 02:09:36 +0000
commit25d7084df05fd181bc0cdda69c6172393950dd90 (patch)
tree765491c553ec6d9070c0f8ca08354a5c44788425
parenta823bc7bd268975d035582e84d3d96149c9f231e (diff)
downloadntapi-25d7084df05fd181bc0cdda69c6172393950dd90.tar.bz2
ntapi-25d7084df05fd181bc0cdda69c6172393950dd90.tar.xz
__ntapi_tt_fork(): never leak the hresumed event handle.
-rw-r--r--src/process/ntapi_tt_fork.c12
1 files changed, 8 insertions, 4 deletions
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)