From 71b73eca6ae6e2b9480e65ee50ee4ff51981fa89 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Thu, 14 Apr 2016 10:20:22 +0000 Subject: Free pipes if worker thread initialization fails --- src/microhttpd/daemon.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index b6885178..bcbe6b50 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c @@ -4402,6 +4402,12 @@ thread_failed: if (0 != (flags & MHD_USE_SSL)) gnutls_priority_deinit (daemon->priority_cache); #endif + if ( (MHD_INVALID_PIPE_ != daemon->wpipe[0]) && + (0 != MHD_pipe_close_ (daemon->wpipe[0])) ) + MHD_PANIC ("close failed\n"); + if ( (MHD_INVALID_PIPE_ != daemon->wpipe[1]) && + (0 != MHD_pipe_close_ (daemon->wpipe[1])) ) + MHD_PANIC ("close failed\n"); free (daemon); return NULL; } -- cgit v1.2.3