Skip to content

Commit

Permalink
n-api: fix memory leak in napi_async_destroy()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
alnyan authored and MylesBorins committed Jan 9, 2018
1 parent 861f6ad commit 79a2833
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2770,6 +2770,8 @@ napi_status napi_async_destroy(napi_env env,
reinterpret_cast<node::async_context*>(async_context);
node::EmitAsyncDestroy(isolate, *node_async_context);

delete node_async_context;

return napi_clear_last_error(env);
}

Expand Down

0 comments on commit 79a2833

Please sign in to comment.