diff --git a/src/node_crypto.cc b/src/node_crypto.cc index fdbd1c6b70bbe4..7b48f30781319a 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1009,7 +1009,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo& 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);