Skip to content

Commit 65ea7ab

Browse files
alnyanMylesBorins
alnyan
authored andcommitted
n-api: fix memory leak in napi_async_destroy()
Backport-PR-URL: #19447 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 412cc17 commit 65ea7ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/node_api.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,6 +2864,8 @@ napi_status napi_async_destroy(napi_env env,
28642864
reinterpret_cast<node::async_context*>(async_context);
28652865
node::EmitAsyncDestroy(isolate, *node_async_context);
28662866

2867+
delete node_async_context;
2868+
28672869
return napi_clear_last_error(env);
28682870
}
28692871

0 commit comments

Comments
 (0)