Browse Source

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.
v0.10.5-release
Trevor Norris 12 years ago
committed by Ben Noordhuis
parent
commit
659fb238e7
  1. 3
      src/node_crypto.cc

3
src/node_crypto.cc

@ -1962,7 +1962,8 @@ Handle<Value> Connection::GetNegotiatedProto(const Arguments& args) {
return False();
}
return String::New((const char*) npn_proto, npn_proto_len);
return scope.Close(String::New(reinterpret_cast<const char*>(npn_proto),
npn_proto_len));
} else {
return ss->selectedNPNProto_;
}

Loading…
Cancel
Save