summaryrefslogtreecommitdiff
path: root/src/node_http_parser.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-08-22 23:57:46 +0200
committerTrevor Norris <trev.norris@gmail.com>2014-09-05 09:33:49 -0700
commitde9a444ab4c1219d36578b9594aee3d039564c3e (patch)
treed16e586207831dcf4d2d291a4062f96a9307786e /src/node_http_parser.cc
parent176f0bd3dfd58faf1675851cd2029e05d302f1fb (diff)
downloadandroid-node-v8-de9a444ab4c1219d36578b9594aee3d039564c3e.tar.gz
android-node-v8-de9a444ab4c1219d36578b9594aee3d039564c3e.tar.bz2
android-node-v8-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>
Diffstat (limited to 'src/node_http_parser.cc')
-rw-r--r--src/node_http_parser.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc
index 911fec398d..04b86097ef 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());