diff --git a/src/crypto/crypto_rsa.cc b/src/crypto/crypto_rsa.cc index e7546cec4c1123..4347bf4efb5406 100644 --- a/src/crypto/crypto_rsa.cc +++ b/src/crypto/crypto_rsa.cc @@ -385,6 +385,8 @@ KeyObjectData ImportJWKRsaKey(Environment* env, KeyType type = d_value->IsString() ? kKeyTypePrivate : kKeyTypePublic; RSAPointer rsa(RSA_new()); + if (!rsa) return {}; + ncrypto::Rsa rsa_view(rsa.get()); ByteSource n = ByteSource::FromEncodedString(env, n_value.As());