mirror of
https://github.com/zebrajr/node.git
synced 2025-12-07 12:20:50 +01:00
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 commit is contained in:
parent
07fbb43d78
commit
c1db1ecd15
|
|
@ -730,6 +730,7 @@ Handle<Value> SecureContext::LoadPKCS12(const Arguments& args) {
|
||||||
|
|
||||||
X509_STORE_add_cert(sc->ca_store_, x509);
|
X509_STORE_add_cert(sc->ca_store_, x509);
|
||||||
SSL_CTX_add_client_CA(sc->ctx_, x509);
|
SSL_CTX_add_client_CA(sc->ctx_, x509);
|
||||||
|
X509_free(x509);
|
||||||
}
|
}
|
||||||
|
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user