From: Jérémie Galarneau Date: Mon, 15 May 2017 14:37:18 +0000 (-0400) Subject: Fix: status_loc argument of waitpid() is used on error X-Git-Tag: v2.8.7~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4c8e238290ce69623f4485b3b6104a5901d8ed0d;p=lttng-tools.git Fix: status_loc argument of waitpid() is used on error waitpid() may leave stat_loc uninitialized on error (depending on errno's value, see WAIT(3)). Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index a12a6a454..8527ad04c 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -605,8 +605,7 @@ static void wait_consumer(struct consumer_data *consumer_data) ret = waitpid(consumer_data->pid, &status, 0); if (ret == -1) { PERROR("consumerd waitpid pid: %d", consumer_data->pid) - } - if (!WIFEXITED(status)) { + } else if (!WIFEXITED(status)) { ERR("consumerd termination with error: %d", WEXITSTATUS(ret)); }