Skip to content

Commit 4058a29

Browse files
romandevmhdawson
authored andcommitted
n-api: fix memory leak in napi_async_destroy()
This is a cherry-pick patch from upstream[1]. [1] nodejs/node@87cb1f5 PR-URL: #213 Reviewed-By: Michael Dawson <[email protected]>
1 parent 4b5a261 commit 4058a29

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
@@ -2855,6 +2855,8 @@ napi_status napi_async_destroy(napi_env env,
28552855
reinterpret_cast<node::async_context*>(async_context);
28562856
node::EmitAsyncDestroy(isolate, *node_async_context);
28572857

2858+
delete node_async_context;
2859+
28582860
return napi_clear_last_error(env);
28592861
}
28602862

0 commit comments

Comments
 (0)