summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2019-06-27 17:36:56 +0100
committerMichaƫl Zasso <targos@protonmail.com>2019-07-02 11:46:56 +0200
commit624fd17064f30e1bf410e394ab1a7c9c54763798 (patch)
tree86043753029cdd21cec41bd1657209b1a79fee21 /src
parentc9a96aeeeebc60b109ab0a9caff24aa0a4a67bcb (diff)
downloadandroid-node-v8-624fd17064f30e1bf410e394ab1a7c9c54763798.tar.gz
android-node-v8-624fd17064f30e1bf410e394ab1a7c9c54763798.tar.bz2
android-node-v8-624fd17064f30e1bf410e394ab1a7c9c54763798.zip
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')
-rw-r--r--src/node_contextify.cc5
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(),