From: Jérémie Galarneau Date: Fri, 31 Aug 2018 17:56:04 +0000 (-0400) Subject: Fix: leak of event attributes on copy failure X-Git-Tag: v2.11.0-rc1~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5ae0c80e1f9a3ed89044a6e810d7d844fab6ba24;p=lttng-tools.git Fix: leak of event attributes on copy failure Reported-by: Coverity Scan (1243042 Resource leak) Signed-off-by: Jérémie Galarneau --- 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; }