From a905c62444dc13fa4547d3b86d5d0f3293fa7021 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 4 Apr 2016 12:41:05 -0400 Subject: [PATCH] Warning fix: possible use of uninitialized variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit GCC reports that discarded_events and lost_packets may be used uninitialized. Assert that both pointers are not NULL to silence the warning. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/cmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index aa030d3b1..ba963ffc5 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -188,6 +188,8 @@ static int get_ust_runtime_stats(struct ltt_session *session, struct ltt_ust_session *usess; usess = session->ust_session; + assert(discarded_events); + assert(lost_packets); if (!usess || !session->has_been_started) { *discarded_events = 0; -- 2.34.1