Fix: sessiond: kernel: leak of notifier rule on failure to init notifier
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 10 Feb 2021 19:08:55 +0000 (14:08 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 10 Feb 2021 19:38:09 +0000 (14:38 -0500)
Coverity reports:
1445768 Resource leak
The system resource will not be reclaimed and reused, reducing the future availability of the resource.
In kernel_create_event_notifier_rule: Leak of memory or pointers to system resources (CWE-404)

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ica3f414fb7640ecddf9affbcc359121b04a82277

src/bin/lttng-sessiond/kernel.c

index dcd33a1b7df241b5a232f4dbcafee18e9cb771e4..2e920286cf60cf35cd5c23dff580f96090a49582 100644 (file)
@@ -2328,7 +2328,7 @@ static enum lttng_error_code kernel_create_event_notifier_rule(
        error_code_ret = trace_kernel_init_event_notifier_from_event_rule(
                        event_rule, &kernel_event_notifier);
        if (error_code_ret != LTTNG_OK) {
-               goto error;
+               goto free_event;
        }
 
        kernel_event_notifier.event.token = event_notifier_rule->token;
This page took 0.026837 seconds and 4 git commands to generate.