From adc8eccbcef62412e04101eb341598a358acab4f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 14 Feb 2020 17:09:58 -0500 Subject: [PATCH] Fix: lttng: uninitialized pointer free'd when no sessiond is present MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/lib/lttng-ctl/rotate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.34.1