From 8f34593b11f3ffd23d95353b558fc50c06fc08ed Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Tue, 3 Dec 2024 21:20:13 +0300 Subject: [PATCH] daemon_start: fixed clean-up of partially initialised thread pool in case of initialisation error --- src/mhd2/daemon_start.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mhd2/daemon_start.c b/src/mhd2/daemon_start.c index 04fd1ce4..5593c2c9 100644 --- a/src/mhd2/daemon_start.c +++ b/src/mhd2/daemon_start.c @@ -2491,14 +2491,13 @@ init_workers_pool (struct MHD_Daemon *restrict d, if (MHD_SC_OK == res) continue; /* Process the next worker */ + /* Below is a clean-up of the current slot */ + #ifdef MHD_USE_EPOLL if (mhd_POLL_TYPE_EPOLL == worker->events.poll_type) deinit_epoll (worker); #endif /* MHD_USE_EPOLL */ - - /* Below is the clean-up of the current slot */ } - free (worker); break; } if (num_workers == i)