From 3a831fa95c49ee98efe72036f8813a64d788d6f8 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 24 Oct 2016 20:30:30 +0900 Subject: [PATCH] nghttpx: Fix file descriptor leak in read_tls_sct_from_dir --- src/shrpx_config.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shrpx_config.cc b/src/shrpx_config.cc index a1a20b70..94cb1227 100644 --- a/src/shrpx_config.cc +++ b/src/shrpx_config.cc @@ -1129,6 +1129,8 @@ int read_tls_sct_from_dir(std::vector &dst, const StringRef &opt, return -1; } + auto closer = defer(close, fd); + // 2 bytes length field for this SCT. auto len_idx = std::distance(std::begin(dst), std::end(dst)); dst.insert(std::end(dst), 2, 0);