Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
crypto: fix memory leak in LoadPKCS12
Browse files Browse the repository at this point in the history
X509_STORE_add_cert increment reference of passed `x509` cert,
`X509_free` must be called to avoid memory leak.
  • Loading branch information
indutny committed Jul 3, 2013
1 parent 07fbb43 commit c1db1ec
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,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);
Expand Down

0 comments on commit c1db1ec

Please sign in to comment.