Skip to content

Commit 79a2833

Browse files
alnyanMylesBorins
alnyan
authored andcommitted
n-api: fix memory leak in napi_async_destroy()
PR-URL: #17714 Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 861f6ad commit 79a2833

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/node_api.cc

+2
Original file line numberDiff line numberDiff line change
@@ -2770,6 +2770,8 @@ napi_status napi_async_destroy(napi_env env,
27702770
reinterpret_cast<node::async_context*>(async_context);
27712771
node::EmitAsyncDestroy(isolate, *node_async_context);
27722772

2773+
delete node_async_context;
2774+
27732775
return napi_clear_last_error(env);
27742776
}
27752777

0 commit comments

Comments
 (0)