From ef046310954c52e68e3a9f769e11c44696ac8089 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 17 May 2016 11:52:47 -0400 Subject: [PATCH] Fix: initialize the cur_event variable before using it MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit CID 1243041 (#1 of 1): Uninitialized scalar variable (UNINIT) uninit_use_in_call: Using uninitialized element of array *cur_event.name when calling strcmp. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- src/bin/lttng/commands/list.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index bcf2f0a5f..796a01784 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -573,6 +573,8 @@ static int mi_list_ust_event_fields(struct lttng_event_field *fields, int count, int event_element_open = 0; struct lttng_event cur_event; + memset(&cur_event, 0, sizeof(cur_event)); + /* Open domains element */ ret = mi_lttng_domains_open(writer); if (ret) { -- 2.34.1