Skip to content

Commit

Permalink
src: fix small memory leak
Browse files Browse the repository at this point in the history
PR-URL: nodejs#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 Trott committed Jun 30, 2019
1 parent 4565292 commit 20d099a
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 20d099a

Please sign in to comment.