From 5ae0c80e1f9a3ed89044a6e810d7d844fab6ba24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 31 Aug 2018 13:56:04 -0400 Subject: [PATCH] Fix: leak of event attributes on copy failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported-by: Coverity Scan (1243042 Resource leak) Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 947c35db7..d8ea2c1a5 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -3683,6 +3683,9 @@ error_add_context: if (!ev) { DBG("Failed to copy event: %s", cmd_ctx->lsm->u.enable.event.name); + free(filter_expression); + free(bytecode); + free(exclusion); ret = LTTNG_ERR_NOMEM; goto error; } @@ -3692,6 +3695,9 @@ error_add_context: /* Expect a userspace probe description. */ ret = receive_userspace_probe(cmd_ctx, sock, sock_error, ev); if (ret) { + free(filter_expression); + free(bytecode); + free(exclusion); lttng_event_destroy(ev); goto error; } -- 2.34.1