diff --git a/src/node_crypto.cc b/src/node_crypto.cc index c62106381023f6..eb5a3573167dd2 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -6085,9 +6085,8 @@ class RSAKeyPairGenerationConfig : public KeyPairGenerationConfig { CHECK_NOT_NULL(bn.get()); CHECK(BN_set_word(bn.get(), exponent_)); // EVP_CTX acceps ownership of bn on success. - if (EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx.get(), bn.get()) <= 0) + if (EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx.get(), bn.release()) <= 0) return false; - bn.release(); } return true;