diff --git a/src/node_crypto.cc b/src/node_crypto.cc index d3fcb4c14ab03b..0408ff0b053759 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -152,7 +152,6 @@ const char* const root_certs[] = { std::string extra_root_certs_file; // NOLINT(runtime/string) X509_STORE* root_cert_store; -std::vector root_certs_vector; // Just to generate static methods template class SSLWrap; @@ -724,6 +723,7 @@ static int X509_up_ref(X509* cert) { static X509_STORE* NewRootCertStore() { + static std::vector root_certs_vector; if (root_certs_vector.empty()) { for (size_t i = 0; i < arraysize(root_certs); i++) { BIO* bp = NodeBIO::NewFixed(root_certs[i], strlen(root_certs[i]));