From: Jérémie Galarneau Date: Wed, 17 Mar 2021 16:16:18 +0000 (-0400) Subject: Fix: ustctl: leak of event notifier data on communication error X-Git-Tag: v2.13.0-rc1~265 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4c4f4917501326b2ede0486a18478e4a6941c287;p=lttng-ust.git Fix: ustctl: leak of event notifier data on communication error The `len != sizeof(*event_notifier)` error path does not free the `event_notifier_data` even though it is not provided to the caller. Signed-off-by: Jérémie Galarneau Signed-off-by: Mathieu Desnoyers Change-Id: Ie3b4ebf77e8ca7205d802c6db67c23c347aa29df --- diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 2a7c7d8a..d1e7eb4e 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -590,6 +590,7 @@ int ustctl_create_event_notifier(int sock, struct lttng_ust_abi_event_notifier * /* Send struct lttng_ust_event_notifier */ len = ustcomm_send_unix_sock(sock, event_notifier, sizeof(*event_notifier)); if (len != sizeof(*event_notifier)) { + free(event_notifier_data); if (len < 0) return len; else