| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e161dcf commit ac2b059
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -123,7 +123,7 @@ const char* const root_certs[] = { | |||
| 123 | 123 | std::string extra_root_certs_file; // NOLINT(runtime/string) | |
| 124 | 124 | ||
| 125 | 125 | X509_STORE* root_cert_store; | |
| 126 | - std::vector<X509*>* root_certs_vector; | ||
| 126 | + std::vector<X509*> root_certs_vector; | ||
| 127 | 127 | ||
| 128 | 128 | // Just to generate static methods | |
| 129 | 129 | template class SSLWrap<TLSWrap>; | |
@@ -693,9 +693,7 @@ static int X509_up_ref(X509* cert) { | |||
| 693 | 693 | ||
| 694 | 694 | ||
| 695 | 695 | static X509_STORE* NewRootCertStore() { | |
| 696 | - if (!root_certs_vector) { | ||
| 697 | - root_certs_vector = new std::vector<X509*>; | ||
| 698 | - | ||
| 696 | + if (root_certs_vector.empty()) { | ||
| 699 | 697 | for (size_t i = 0; i < arraysize(root_certs); i++) { | |
| 700 | 698 | BIO* bp = NodeBIO::NewFixed(root_certs[i], strlen(root_certs[i])); | |
| 701 | 699 | X509 *x509 = PEM_read_bio_X509(bp, nullptr, CryptoPemCallback, nullptr); | |
@@ -704,12 +702,12 @@ static X509_STORE* NewRootCertStore() { | |||
| 704 | 702 | // Parse errors from the built-in roots are fatal. | |
| 705 | 703 | CHECK_NE(x509, nullptr); | |
| 706 | 704 | ||
| 707 | - root_certs_vector->push_back(x509); | ||
| 705 | + root_certs_vector.push_back(x509); | ||
| 708 | 706 | } | |
| 709 | 707 | } | |
| 710 | 708 | ||
| 711 | 709 | X509_STORE* store = X509_STORE_new(); | |
| 712 | - for (auto& cert : *root_certs_vector) { | ||
| 710 | + for (X509 *cert : root_certs_vector) { | ||
| 713 | 711 | X509_up_ref(cert); | |
| 714 | 712 | X509_STORE_add_cert(store, cert); | |
| 715 | 713 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments