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.13.0-rc1~764 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=25357057de5ae4dd2a572e8f9b893c1b90cbd60a 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 daba7afa2..2dbaa46a3 100644 --- a/src/lib/lttng-ctl/rotate.c +++ b/src/lib/lttng-ctl/rotate.c @@ -362,7 +362,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;