Fix: sessiond: error accounting: leak of cpu_counter array on error path
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Apr 2021 16:07:43 +0000 (12:07 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Apr 2021 16:55:39 +0000 (12:55 -0400)
1452202 Resource leak

The system resource will not be reclaimed and reused, reducing the future availability of the resource.

In event_notifier_error_accounting_register_app: 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: I07cc8808b05c497b9bc3099deca58e14f721c5a1

src/bin/lttng-sessiond/event-notifier-error-accounting.c

index 34dc2b4fe30e8011ca5998407529d5dc0bd3f388..f0e567f72ed110b6348f99e08baa946d20aa05e8 100644 (file)
@@ -497,6 +497,8 @@ error_duplicate_cpu_counter:
                free(cpu_counters[i]);
        }
 
+       free(cpu_counters);
+
 error_allocate_cpu_counters:
 error_send_counter_data:
        ustctl_release_object(-1, new_counter);
This page took 0.025232 seconds and 4 git commands to generate.