diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 4a02812d58..667f1e3b93 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_; }