diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2014-08-22 23:57:46 +0200 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2014-09-05 09:33:49 -0700 |
commit | de9a444ab4c1219d36578b9594aee3d039564c3e (patch) | |
tree | d16e586207831dcf4d2d291a4062f96a9307786e | |
parent | 176f0bd3dfd58faf1675851cd2029e05d302f1fb (diff) | |
download | nodejs-de9a444ab4c1219d36578b9594aee3d039564c3e.tar.gz nodejs-de9a444ab4c1219d36578b9594aee3d039564c3e.tar.bz2 nodejs-de9a444ab4c1219d36578b9594aee3d039564c3e.zip |
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>
-rw-r--r-- | src/node_http_parser.cc | 2 |
1 files changed, 1 insertions, 1 deletions
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<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()); |