diff options
author | David Carlier <devnexen@gmail.com> | 2019-06-27 19:36:56 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-07-01 00:31:10 +0300 |
commit | 20d099af7a1fc103ecfb9a4afe59fd2fdcbe7802 (patch) | |
tree | c789f1eb6f39e95a631dd84d15028b36a3549c62 /src/node_contextify.cc | |
parent | 4565292a771249e0bea3e8b1a69c5c6a7549fffa (diff) |
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>
Diffstat (limited to 'src/node_contextify.cc')
-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 70c63a0d8a3..a13eed9d0ff 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(), |