src: fix small memory leak
PR-URL: https://github.com/nodejs/node/pull/28452 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
4565292a77
commit
20d099af7a
@ -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(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user