From: Jérémie Galarneau Date: Mon, 11 Nov 2013 20:30:08 +0000 (-0500) Subject: Fix: Don't dispatch uninitialized hash tables to the ht_cleanup thread X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=e7e84b727ee41e05f67e9002e1bfdbe411c2c62a Fix: Don't dispatch uninitialized hash tables to the ht_cleanup thread Some error-handling code paths may call ht_cleanup_push() with NULL hash tables which will crash the clean-up thread. Signed-off-by: Jérémie Galarneau Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/utils.c b/src/bin/lttng-sessiond/utils.c index 2ff57cd14..c9c51ede5 100644 --- a/src/bin/lttng-sessiond/utils.c +++ b/src/bin/lttng-sessiond/utils.c @@ -52,6 +52,9 @@ void ht_cleanup_push(struct lttng_ht *ht) ssize_t ret; int fd = ht_cleanup_pipe[1]; + if (!ht) { + return; + } if (fd < 0) return; ret = lttng_write(fd, &ht, sizeof(ht));