mirror of https://github.com/nodejs/node.git
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>pull/23396/head
parent
176f0bd3df
commit
de9a444ab4
|
@ -373,8 +373,8 @@ class Parser : public BaseObject {
|
|||
|
||||
// var bytesParsed = parser->execute(buffer);
|
||||
static void Execute(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleScope handle_scope(args.GetIsolate());
|
||||
Environment* env = Environment::GetCurrent(args.GetIsolate());
|
||||
HandleScope scope(env->isolate());
|
||||
|
||||
Parser* parser = Unwrap<Parser>(args.Holder());
|
||||
assert(parser->current_buffer_.IsEmpty());
|
||||
|
|
Loading…
Reference in New Issue