diff --git a/deps/ncrypto/ncrypto.cc b/deps/ncrypto/ncrypto.cc index 07049405de6239..b7962513a78530 100644 --- a/deps/ncrypto/ncrypto.cc +++ b/deps/ncrypto/ncrypto.cc @@ -2828,7 +2828,9 @@ SSL* SSLPointer::release() { SSLPointer SSLPointer::New(const SSLCtxPointer& ctx) { if (!ctx) return {}; - return SSLPointer(SSL_new(ctx.get())); + SSL* ssl = SSL_new(ctx.get()); + if (ssl == nullptr) return {}; + return SSLPointer(ssl); } void SSLPointer::getCiphers(std::function cb) const {