gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] branch master updated: daemon.c: fixed leak of resources


From: gnunet
Subject: [libmicrohttpd] branch master updated: daemon.c: fixed leak of resources if daemon is failed to start
Date: Fri, 23 Oct 2020 13:47:08 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new 3460db01 daemon.c: fixed leak of resources if daemon is failed to start
3460db01 is described below

commit 3460db01ec7e2b042296d7f703dfa344c893f5ea
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Oct 23 14:31:25 2020 +0300

    daemon.c: fixed leak of resources if daemon is failed to start
---
 src/microhttpd/daemon.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 10072078..7ffd93cd 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -6730,7 +6730,11 @@ MHD_start_daemon_va (unsigned int flags,
 #ifdef EPOLL_SUPPORT
         if ( (0 != (*pflags & MHD_USE_EPOLL)) &&
              (MHD_NO == setup_epoll_to_listen (d)) )
+        {
+          if (MHD_ITC_IS_VALID_ (d->itc))
+            MHD_itc_destroy_chk_ (d->itc);
           goto thread_failed;
+        }
 #endif
         /* Must init cleanup connection mutex for each worker */
         if (! MHD_mutex_init_ (&d->cleanup_connection_mutex))
@@ -6739,6 +6743,8 @@ MHD_start_daemon_va (unsigned int flags,
           MHD_DLOG (daemon,
                     _ ("MHD failed to initialize cleanup connection 
mutex.\n"));
 #endif
+          if (MHD_ITC_IS_VALID_ (d->itc))
+            MHD_itc_destroy_chk_ (d->itc);
           goto thread_failed;
         }
 
@@ -6757,6 +6763,8 @@ MHD_start_daemon_va (unsigned int flags,
           /* Free memory for this worker; cleanup below handles
            * all previously-created workers. */
           MHD_mutex_destroy_chk_ (&d->cleanup_connection_mutex);
+          if (MHD_ITC_IS_VALID_ (d->itc))
+            MHD_itc_destroy_chk_ (d->itc);
           goto thread_failed;
         }
       }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]