Skip to content

Commit 624fd17

Browse files
devnexentargos
authored andcommitted
src: fix small memory leak
PR-URL: #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]>
1 parent c9a96ae commit 624fd17

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node_contextify.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,14 @@ void ContextifyContext::MakeContext(const FunctionCallbackInfo<Value>& args) {
260260
if (try_catch.HasCaught()) {
261261
if (!try_catch.HasTerminated())
262262
try_catch.ReThrow();
263+
delete context;
263264
return;
264265
}
265266

266-
if (context->context().IsEmpty())
267+
if (context->context().IsEmpty()) {
268+
delete context;
267269
return;
270+
}
268271

269272
sandbox->SetPrivate(
270273
env->context(),

0 commit comments

Comments
 (0)