diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 8a02d30e79b921..31f469286a71c7 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3931,6 +3931,8 @@ bool PublicKeyCipher::Cipher(const char* key_pem, fatal = false; exit: + if (x509 != nullptr) + X509_free(x509); if (pkey != nullptr) EVP_PKEY_free(pkey); if (bp != nullptr)