From de9a444ab4c1219d36578b9594aee3d039564c3e Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 22 Aug 2014 23:57:46 +0200 Subject: src: fix handle leak in Parser::Execute() Fix a resource leak where an intermediate Local handle in Environment::GetCurrent() got leaked into whatever HandleScope was further up the stack. Reviewed-by: Trevor Norris --- src/node_http_parser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 911fec398..04b86097e 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -373,8 +373,8 @@ class Parser : public BaseObject { // var bytesParsed = parser->execute(buffer); static void Execute(const FunctionCallbackInfo& args) { + HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Parser* parser = Unwrap(args.Holder()); assert(parser->current_buffer_.IsEmpty()); -- cgit v1.2.3