From: Jérémie Galarneau Date: Fri, 14 Feb 2020 22:09:58 +0000 (-0500) Subject: Fix: lttng: uninitialized pointer free'd when no sessiond is present X-Git-Tag: v2.11.3~10 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=adc8eccbcef62412e04101eb341598a358acab4f;p=lttng-tools.git Fix: lttng: uninitialized pointer free'd when no sessiond is present The error path of get_schedules assumes that schedules_comm is !NULL, which is not the case currently. Signed-off-by: Jérémie Galarneau Change-Id: I16e2d9d45cd3df9cfa80214abe03bcc782fa1f11 --- diff --git a/src/lib/lttng-ctl/rotate.c b/src/lib/lttng-ctl/rotate.c index bc3a63cc8..bd02a940c 100644 --- a/src/lib/lttng-ctl/rotate.c +++ b/src/lib/lttng-ctl/rotate.c @@ -372,7 +372,7 @@ int get_schedules(const char *session_name, { int ret; struct lttcomm_session_msg lsm; - struct lttng_session_list_schedules_return *schedules_comm; + struct lttng_session_list_schedules_return *schedules_comm = NULL; struct lttng_rotation_schedules *schedules = NULL; struct lttng_rotation_schedule *periodic = NULL, *size = NULL;