mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
crypto: fix memory leak in LoadPKCS12
`sk_X509_pop_free` should be used instead of `sk_X509_free` to free all items in queue too, not just the queue itself. PR-URL: https://github.com/nodejs/node/pull/5109 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
This commit is contained in:
1 parent
d9e934c71f
commit
ec62789152
1 file changed
+1
-1
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user