diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-04-14 10:20:22 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-04-14 10:20:22 +0000 |
commit | 71b73eca6ae6e2b9480e65ee50ee4ff51981fa89 (patch) | |
tree | 47227710195fe5635929e87e0b4530550e596b28 | |
parent | 52fb224d500479062c769ef10bdb0cb74ab483b8 (diff) | |
download | libmicrohttpd-71b73eca6ae6e2b9480e65ee50ee4ff51981fa89.tar.gz libmicrohttpd-71b73eca6ae6e2b9480e65ee50ee4ff51981fa89.zip |
Free pipes if worker thread initialization fails
-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 b6885178..bcbe6b50 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -4402,6 +4402,12 @@ thread_failed: | |||
4402 | if (0 != (flags & MHD_USE_SSL)) | 4402 | if (0 != (flags & MHD_USE_SSL)) |
4403 | gnutls_priority_deinit (daemon->priority_cache); | 4403 | gnutls_priority_deinit (daemon->priority_cache); |
4404 | #endif | 4404 | #endif |
4405 | if ( (MHD_INVALID_PIPE_ != daemon->wpipe[0]) && | ||
4406 | (0 != MHD_pipe_close_ (daemon->wpipe[0])) ) | ||
4407 | MHD_PANIC ("close failed\n"); | ||
4408 | if ( (MHD_INVALID_PIPE_ != daemon->wpipe[1]) && | ||
4409 | (0 != MHD_pipe_close_ (daemon->wpipe[1])) ) | ||
4410 | MHD_PANIC ("close failed\n"); | ||
4405 | free (daemon); | 4411 | free (daemon); |
4406 | return NULL; | 4412 | return NULL; |
4407 | } | 4413 | } |