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.

This is a back-port of commit c1db1ec from the master branch.
This commit is contained in:
Fedor Indutny committed 2013-07-29 13:20:20 +04:00
1 parent ccad4c7fbc
commit 42f926ece7
1 file changed
+1
+1
View File
@@ -640,6 +640,7 @@ Handle<Value> 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);