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.9.5~13 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=78f1416ae5653e08758df32eeb0338e0f5c22acd;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 172f8c270..0df0b1f2e 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -564,8 +564,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)); }