Skip to content

Commit 4ef5c40

Browse files
committed
fixup! tls: implement tls.getCACertificates()
1 parent fc4d62f commit 4ef5c40

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/crypto/crypto_context.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,6 @@ static void LoadCertsFromDir(std::vector<X509*>* certs,
661661
return;
662662
}
663663

664-
uv_fs_t stats_req;
665-
auto cleanup_stats =
666-
OnScopeLeave([&stats_req]() { uv_fs_req_cleanup(&stats_req); });
667664
for (;;) {
668665
uv_dirent_t ent;
669666

@@ -680,12 +677,14 @@ static void LoadCertsFromDir(std::vector<X509*>* certs,
680677
return;
681678
}
682679

680+
uv_fs_t stats_req;
683681
std::string file_path = std::string(cert_dir) + "/" + ent.name;
684682
int stats_r = uv_fs_stat(nullptr, &stats_req, file_path.c_str(), nullptr);
685683
if (stats_r == 0 &&
686684
(static_cast<uv_stat_t*>(stats_req.ptr)->st_mode & S_IFREG)) {
687685
LoadCertsFromFile(certs, file_path.c_str());
688686
}
687+
uv_fs_req_cleanup(&stats_req);
689688
}
690689
}
691690

0 commit comments

Comments
 (0)