Skip to content

Commit

Permalink
src: fix small memory leak
Browse files Browse the repository at this point in the history
PR-URL: #28452
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
devnexen authored and targos committed Jul 2, 2019
1 parent c9a96ae commit 624fd17
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,14 @@ void ContextifyContext::MakeContext(const FunctionCallbackInfo<Value>& args) {
if (try_catch.HasCaught()) {
if (!try_catch.HasTerminated())
try_catch.ReThrow();
delete context;
return;
}

if (context->context().IsEmpty())
if (context->context().IsEmpty()) {
delete context;
return;
}

sandbox->SetPrivate(
env->context(),
Expand Down

0 comments on commit 624fd17

Please sign in to comment.