Skip to content

Commit de9a444

Browse files
bnoordhuistrevnorris
authored andcommitted
src: fix handle leak in Parser::Execute()
Fix a resource leak where an intermediate Local<Context> handle in Environment::GetCurrent() got leaked into whatever HandleScope was further up the stack. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
1 parent 176f0bd commit de9a444

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/node_http_parser.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ class Parser : public BaseObject {
373373

374374
// var bytesParsed = parser->execute(buffer);
375375
static void Execute(const FunctionCallbackInfo<Value>& args) {
376+
HandleScope handle_scope(args.GetIsolate());
376377
Environment* env = Environment::GetCurrent(args.GetIsolate());
377-
HandleScope scope(env->isolate());
378378

379379
Parser* parser = Unwrap<Parser>(args.Holder());
380380
assert(parser->current_buffer_.IsEmpty());

0 commit comments

Comments
 (0)