From 4c4f4917501326b2ede0486a18478e4a6941c287 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 17 Mar 2021 12:16:18 -0400 Subject: [PATCH] Fix: ustctl: leak of event notifier data on communication error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- liblttng-ust-ctl/ustctl.c | 1 + 1 file changed, 1 insertion(+) 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 -- 2.34.1