libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 9f7422a6f643c0a05a9f1ed66c84cf9d1eaae253
parent 24a401fd5bd6636312a8e8b40665e1ee77d66d0a
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 14 Sep 2011 11:44:18 +0000

fixing 1766

Diffstat:
MChangeLog | 4++++
Msrc/daemon/daemon.c | 20++++++++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +Wed Sep 14 13:43:26 CEST 2011 + Fixing minor memory leak if daemon with HTTPS support failed to + initialize (#1766). -CG + Tue Sep 13 09:47:58 CEST 2011 Try to release responses more promptly upon connection termination. -CG diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c @@ -2005,6 +2005,10 @@ MHD_start_daemon_va (unsigned int options, if (MHD_YES != parse_options_va (retVal, &servaddr, ap)) { +#if HTTPS_SUPPORT + if (options & MHD_USE_SSL) + gnutls_priority_deinit (retVal->priority_cache); +#endif free (retVal); return NULL; } @@ -2019,6 +2023,10 @@ MHD_start_daemon_va (unsigned int options, MHD_DLOG (retVal, "Specified value for NC_SIZE too large\n"); #endif +#if HTTPS_SUPPORT + if (options & MHD_USE_SSL) + gnutls_priority_deinit (retVal->priority_cache); +#endif free (retVal); return NULL; } @@ -2030,6 +2038,10 @@ MHD_start_daemon_va (unsigned int options, "Failed to allocate memory for nonce-nc map: %s\n", STRERROR (errno)); #endif +#if HTTPS_SUPPORT + if (options & MHD_USE_SSL) + gnutls_priority_deinit (retVal->priority_cache); +#endif free (retVal); return NULL; } @@ -2041,6 +2053,10 @@ MHD_start_daemon_va (unsigned int options, MHD_DLOG (retVal, "MHD failed to initialize nonce-nc mutex\n"); #endif +#if HTTPS_SUPPORT + if (options & MHD_USE_SSL) + gnutls_priority_deinit (retVal->priority_cache); +#endif free (retVal->nnc); free (retVal); return NULL; @@ -2362,6 +2378,10 @@ thread_failed: free (retVal->nnc); pthread_mutex_destroy (&retVal->nnc_lock); #endif +#if HTTPS_SUPPORT + if (options & MHD_USE_SSL) + gnutls_priority_deinit (retVal->priority_cache); +#endif free (retVal); return NULL; }