From: Jérémie Galarneau Date: Mon, 19 Apr 2021 15:00:23 +0000 (-0400) Subject: Clean-up: sessiond: cmd: fix bogus -Wmaybe-uninitialized X-Git-Tag: v2.13.0-rc1~74 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3e47be6dfb6ce33d0879ed2b28175ebf429e9c01;p=lttng-tools.git Clean-up: sessiond: cmd: fix bogus -Wmaybe-uninitialized Old gcc versions report: cmd.c:4751: ‘query_target_action’ may be used uninitialized in this function [-Wmaybe-uninitialized] For this to be reachable, a query target would have to change suddenly during the execution of the function. Signed-off-by: Jérémie Galarneau Change-Id: Id90ca37e232385f73d54558f2a00d01cbf773a92 --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 3fab5af02..76258dc87 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4660,7 +4660,7 @@ enum lttng_error_code cmd_execute_error_query(const struct lttng_credentials *cm { enum lttng_error_code ret_code; const struct lttng_trigger *query_target_trigger; - struct lttng_action *query_target_action; + struct lttng_action *query_target_action = NULL; struct lttng_trigger *matching_trigger = NULL; const char *trigger_name; uid_t trigger_owner;