Skip to content

Commit

Permalink
crypto: fix memory leak in LoadPKCS12
Browse files Browse the repository at this point in the history
`sk_X509_pop_free` should be used instead of `sk_X509_free` to free all
items in queue too, not just the queue itself.
  • Loading branch information
indutny committed Feb 6, 2016
1 parent c58197f commit b5d9dcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
if (cert != nullptr)
X509_free(cert);
if (extra_certs != nullptr)
sk_X509_free(extra_certs);
sk_X509_pop_free(extra_certs, X509_free);

PKCS12_free(p12);
BIO_free_all(in);
Expand Down

0 comments on commit b5d9dcf

Please sign in to comment.