From a0c402a1dd71070392848b7510420f2ee9d6bd52 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 26 Apr 2014 18:45:47 +0200 Subject: [PATCH] Fix a bug where a socket could be closed twice. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This would only happen if a HTTP input that wasn't fully setup yet was no longer in use after an reload. This would normally manifest itself as a “close(): Bad file descriptor”, but could also end up closing an arbitrary descriptor, causing various sorts of havoc. --- httpinput.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/httpinput.cpp b/httpinput.cpp index 68b9170..478356e 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -94,6 +94,7 @@ void HTTPInput::close_socket() { if (sock != -1) { safe_close(sock); + sock = -1; } MutexLock lock(&stats_mutex); -- 2.39.2