summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2017-05-02 14:55:58 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2017-05-04 14:33:36 +0200
commitd0c968ea57560f3035c60d41eb761feb95894787 (patch)
tree94bdaf09526a33d978f602483dbef7cf32417dba /src
parentebcd8c6bb880a83f722d2262a6231b969211d290 (diff)
downloadandroid-node-v8-d0c968ea57560f3035c60d41eb761feb95894787.tar.gz
android-node-v8-d0c968ea57560f3035c60d41eb761feb95894787.tar.bz2
android-node-v8-d0c968ea57560f3035c60d41eb761feb95894787.zip
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: https://github.com/nodejs/node/pull/12788 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Diffstat (limited to 'src')
-rw-r--r--src/node_crypto.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index d3fcb4c14a..0408ff0b05 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<X509*> root_certs_vector;
// Just to generate static methods
template class SSLWrap<TLSWrap>;
@@ -724,6 +723,7 @@ static int X509_up_ref(X509* cert) {
static X509_STORE* NewRootCertStore() {
+ static std::vector<X509*> 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]));