From f4d35a34c98ff8cb45766a7de2a2f8b4932ee59c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 5 Aug 2015 18:42:42 +0200 Subject: [PATCH] src/nhttpd/yhttpd_core/ywebserver.cpp fix sanitize --- src/nhttpd/yhttpd_core/ywebserver.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/yhttpd_core/ywebserver.cpp b/src/nhttpd/yhttpd_core/ywebserver.cpp index e6b173a9e..0a8b4d77a 100644 --- a/src/nhttpd/yhttpd_core/ywebserver.cpp +++ b/src/nhttpd/yhttpd_core/ywebserver.cpp @@ -497,13 +497,16 @@ void *WebThread(void *args) { log_level_printf(2,"FD SHOULD CLOSE sock:%d!!!\n",con->sock->get_socket()); else ws->addSocketToMasterSet(con->sock->get_socket()); // add to master set -#else - delete newConn->ySock; #endif if (!con->keep_alive) con->sock->isValid = false; con->sock->handling = false; // socket can be handled by webserver main loop (select) again +#ifndef Y_CONFIG_FEATURE_KEEP_ALIVE + delete newConn->ySock; + newConn->ySock = NULL; +#endif + // (4) end thread delete con; int thread_number = newConn->thread_number;