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.

This is a back-port of commit c1db1ec from the master branch.
  • Loading branch information
indutny committed Jul 29, 2013
1 parent ccad4c7 commit 42f926e
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 @@ -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);
Expand Down

0 comments on commit 42f926e

Please sign in to comment.