From c1db1ecd15fd796b68311c67288b395e7784defd Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 27 Jun 2013 19:53:29 +0200 Subject: [PATCH] crypto: fix memory leak in LoadPKCS12 X509_STORE_add_cert increment reference of passed `x509` cert, `X509_free` must be called to avoid memory leak. --- src/node_crypto.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index fffe6b64389..c902bcb7aa8 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -730,6 +730,7 @@ Handle SecureContext::LoadPKCS12(const Arguments& args) { X509_STORE_add_cert(sc->ca_store_, x509); SSL_CTX_add_client_CA(sc->ctx_, x509); + X509_free(x509); } EVP_PKEY_free(pkey);