diff options
-rw-r--r-- | src/node_contextify.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 70c63a0d8a..a13eed9d0f 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -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(), |