diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 92cf0efda19..6fdf95a59dc 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1001,7 +1001,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);