aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-09-14 11:44:18 +0000
committerChristian Grothoff <christian@grothoff.org>2011-09-14 11:44:18 +0000
commit9f7422a6f643c0a05a9f1ed66c84cf9d1eaae253 (patch)
tree10d3aa2787d91b694913496ef9d1c68105c00351
parent24a401fd5bd6636312a8e8b40665e1ee77d66d0a (diff)
downloadlibmicrohttpd-9f7422a6f643c0a05a9f1ed66c84cf9d1eaae253.tar.gz
libmicrohttpd-9f7422a6f643c0a05a9f1ed66c84cf9d1eaae253.zip
fixing 1766
-rw-r--r--ChangeLog4
-rw-r--r--src/daemon/daemon.c20
2 files changed, 24 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1e2a970e..44ef5322 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
1Wed Sep 14 13:43:26 CEST 2011
2 Fixing minor memory leak if daemon with HTTPS support failed to
3 initialize (#1766). -CG
4
1Tue Sep 13 09:47:58 CEST 2011 5Tue Sep 13 09:47:58 CEST 2011
2 Try to release responses more promptly upon connection termination. -CG 6 Try to release responses more promptly upon connection termination. -CG
3 7
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index c23a4327..b0aca594 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -2005,6 +2005,10 @@ MHD_start_daemon_va (unsigned int options,
2005 2005
2006 if (MHD_YES != parse_options_va (retVal, &servaddr, ap)) 2006 if (MHD_YES != parse_options_va (retVal, &servaddr, ap))
2007 { 2007 {
2008#if HTTPS_SUPPORT
2009 if (options & MHD_USE_SSL)
2010 gnutls_priority_deinit (retVal->priority_cache);
2011#endif
2008 free (retVal); 2012 free (retVal);
2009 return NULL; 2013 return NULL;
2010 } 2014 }
@@ -2019,6 +2023,10 @@ MHD_start_daemon_va (unsigned int options,
2019 MHD_DLOG (retVal, 2023 MHD_DLOG (retVal,
2020 "Specified value for NC_SIZE too large\n"); 2024 "Specified value for NC_SIZE too large\n");
2021#endif 2025#endif
2026#if HTTPS_SUPPORT
2027 if (options & MHD_USE_SSL)
2028 gnutls_priority_deinit (retVal->priority_cache);
2029#endif
2022 free (retVal); 2030 free (retVal);
2023 return NULL; 2031 return NULL;
2024 } 2032 }
@@ -2030,6 +2038,10 @@ MHD_start_daemon_va (unsigned int options,
2030 "Failed to allocate memory for nonce-nc map: %s\n", 2038 "Failed to allocate memory for nonce-nc map: %s\n",
2031 STRERROR (errno)); 2039 STRERROR (errno));
2032#endif 2040#endif
2041#if HTTPS_SUPPORT
2042 if (options & MHD_USE_SSL)
2043 gnutls_priority_deinit (retVal->priority_cache);
2044#endif
2033 free (retVal); 2045 free (retVal);
2034 return NULL; 2046 return NULL;
2035 } 2047 }
@@ -2041,6 +2053,10 @@ MHD_start_daemon_va (unsigned int options,
2041 MHD_DLOG (retVal, 2053 MHD_DLOG (retVal,
2042 "MHD failed to initialize nonce-nc mutex\n"); 2054 "MHD failed to initialize nonce-nc mutex\n");
2043#endif 2055#endif
2056#if HTTPS_SUPPORT
2057 if (options & MHD_USE_SSL)
2058 gnutls_priority_deinit (retVal->priority_cache);
2059#endif
2044 free (retVal->nnc); 2060 free (retVal->nnc);
2045 free (retVal); 2061 free (retVal);
2046 return NULL; 2062 return NULL;
@@ -2362,6 +2378,10 @@ thread_failed:
2362 free (retVal->nnc); 2378 free (retVal->nnc);
2363 pthread_mutex_destroy (&retVal->nnc_lock); 2379 pthread_mutex_destroy (&retVal->nnc_lock);
2364#endif 2380#endif
2381#if HTTPS_SUPPORT
2382 if (options & MHD_USE_SSL)
2383 gnutls_priority_deinit (retVal->priority_cache);
2384#endif
2365 free (retVal); 2385 free (retVal);
2366 return NULL; 2386 return NULL;
2367} 2387}