commit 302d381133a26e6223766eea094a784993022fc4
parent dad0746a1006e7c2bd856fd4767b34c7cd6e0f74
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 11 Jan 2019 21:17:31 +0100
fix memory leak with TLS if daemon startup fails as reported by Nicolas Mora on the list
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -6375,7 +6375,13 @@ thread_failed:
#endif
#ifdef HTTPS_SUPPORT
if (0 != (*pflags & MHD_USE_TLS))
+ {
gnutls_priority_deinit (daemon->priority_cache);
+ if (daemon->x509_cred)
+ gnutls_certificate_free_credentials (daemon->x509_cred);
+ if (daemon->psk_cred)
+ gnutls_psk_free_server_credentials (daemon->psk_cred);
+ }
#endif /* HTTPS_SUPPORT */
if (MHD_ITC_IS_VALID_(daemon->itc))
MHD_itc_destroy_chk_ (daemon->itc);