nghttpx: Fix file descriptor leak in read_tls_sct_from_dir

This commit is contained in:
Tatsuhiro Tsujikawa 2016-10-24 20:30:30 +09:00
parent 5b9cacc2d7
commit 3a831fa95c
1 changed files with 2 additions and 0 deletions

View File

@ -1129,6 +1129,8 @@ int read_tls_sct_from_dir(std::vector<uint8_t> &dst, const StringRef &opt,
return -1; return -1;
} }
auto closer = defer(close, fd);
// 2 bytes length field for this SCT. // 2 bytes length field for this SCT.
auto len_idx = std::distance(std::begin(dst), std::end(dst)); auto len_idx = std::distance(std::begin(dst), std::end(dst));
dst.insert(std::end(dst), 2, 0); dst.insert(std::end(dst), 2, 0);