Skip to content

Commit 9ca67e0

Browse files
danbevMylesBorins
authored andcommitted
src: make root_cert_vector function scoped
root_cert_vector currently has file scope and external linkage, but is only used in the NewRootCertsStore function. If this is not required to be externally linked perhaps it can be changed to be static and function scoped instead. PR-URL: #12788 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Shigeki Ohtsu <[email protected]>
1 parent 7fe441d commit 9ca67e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_crypto.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ const char* const root_certs[] = {
127127
std::string extra_root_certs_file; // NOLINT(runtime/string)
128128

129129
X509_STORE* root_cert_store;
130-
std::vector<X509*> root_certs_vector;
131130

132131
// Just to generate static methods
133132
template class SSLWrap<TLSWrap>;
@@ -710,6 +709,7 @@ static int X509_up_ref(X509* cert) {
710709

711710

712711
static X509_STORE* NewRootCertStore() {
712+
static std::vector<X509*> root_certs_vector;
713713
if (root_certs_vector.empty()) {
714714
for (size_t i = 0; i < arraysize(root_certs); i++) {
715715
BIO* bp = NodeBIO::NewFixed(root_certs[i], strlen(root_certs[i]));

0 commit comments

Comments
 (0)