From 6a16368611a25b6cac8fc3d0f4648ae787642b28 Mon Sep 17 00:00:00 2001 From: Karl Skomski Date: Fri, 14 Aug 2015 14:28:39 +0200 Subject: [PATCH] crypto: fix memory leak in PublicKeyCipher::Cipher PR-URL: https://github.com/nodejs/node/pull/2375 Reviewed-By: Ben Noordhuis --- src/node_crypto.cc | 2 ++ 1 file changed, 2 insertions(+) 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)