From e7e84b727ee41e05f67e9002e1bfdbe411c2c62a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 11 Nov 2013 15:30:08 -0500 Subject: [PATCH] Fix: Don't dispatch uninitialized hash tables to the ht_cleanup thread MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng-sessiond/utils.c | 3 +++ 1 file changed, 3 insertions(+) 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)); -- 2.34.1