diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-01-11 21:17:31 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-01-11 21:17:41 +0100 |
commit | 302d381133a26e6223766eea094a784993022fc4 (patch) | |
tree | 9074ef8f372a20b58eae23d6a21ae79ed7d36e30 | |
parent | dad0746a1006e7c2bd856fd4767b34c7cd6e0f74 (diff) | |
download | libmicrohttpd-302d381133a26e6223766eea094a784993022fc4.tar.gz libmicrohttpd-302d381133a26e6223766eea094a784993022fc4.zip |
fix memory leak with TLS if daemon startup fails as reported by Nicolas Mora on the list
-rw-r--r-- | src/microhttpd/daemon.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 4fc5b1b6..ab75273b 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -6375,7 +6375,13 @@ thread_failed: | |||
6375 | #endif | 6375 | #endif |
6376 | #ifdef HTTPS_SUPPORT | 6376 | #ifdef HTTPS_SUPPORT |
6377 | if (0 != (*pflags & MHD_USE_TLS)) | 6377 | if (0 != (*pflags & MHD_USE_TLS)) |
6378 | { | ||
6378 | gnutls_priority_deinit (daemon->priority_cache); | 6379 | gnutls_priority_deinit (daemon->priority_cache); |
6380 | if (daemon->x509_cred) | ||
6381 | gnutls_certificate_free_credentials (daemon->x509_cred); | ||
6382 | if (daemon->psk_cred) | ||
6383 | gnutls_psk_free_server_credentials (daemon->psk_cred); | ||
6384 | } | ||
6379 | #endif /* HTTPS_SUPPORT */ | 6385 | #endif /* HTTPS_SUPPORT */ |
6380 | if (MHD_ITC_IS_VALID_(daemon->itc)) | 6386 | if (MHD_ITC_IS_VALID_(daemon->itc)) |
6381 | MHD_itc_destroy_chk_ (daemon->itc); | 6387 | MHD_itc_destroy_chk_ (daemon->itc); |