From 659fb238e7f1c837978c2ee661385b691a18a8ac Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Wed, 17 Apr 2013 11:45:13 -0700 Subject: [PATCH] crypto: fix return Local Handle w/o scope.Close() A new String was being created and returned, but was not sent through the scope.Close(), which caused it to be cleaned up before being returned. --- src/node_crypto.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 4a02812..667f1e3 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1962,7 +1962,8 @@ Handle Connection::GetNegotiatedProto(const Arguments& args) { return False(); } - return String::New((const char*) npn_proto, npn_proto_len); + return scope.Close(String::New(reinterpret_cast(npn_proto), + npn_proto_len)); } else { return ss->selectedNPNProto_; } -- 2.7.4