Fix: leak of event attributes on copy failure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 31 Aug 2018 17:56:04 +0000 (13:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 31 Aug 2018 17:56:06 +0000 (13:56 -0400)
Reported-by: Coverity Scan (1243042 Resource leak)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/main.c

index 947c35db7cda8c92bd44bbe55fcc40513ed26698..d8ea2c1a5b2640af24864c6d12d6c91c8dd78001 100644 (file)
@@ -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;
                        }
This page took 0.027681 seconds and 4 git commands to generate.