Browse Source

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>
v0.11.14-release
Ben Noordhuis 10 years ago
committed by Trevor Norris
parent
commit
de9a444ab4
  1. 2
      src/node_http_parser.cc

2
src/node_http_parser.cc

@ -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…
Cancel
Save