Bläddra i källkod

daemon_start: fixed clean-up of partially initialised thread pool in case of initialisation error

Evgeny Grin (Karlson2k) 1 år sedan
förälder
incheckning
8f34593b11
1 ändrade filer med 2 tillägg och 3 borttagningar
  1. 2 3
      src/mhd2/daemon_start.c

+ 2 - 3
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)