Fix: lttng: add-trigger: leak of source argument
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 26 Feb 2021 19:02:06 +0000 (14:02 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 4 Mar 2021 16:59:19 +0000 (11:59 -0500)
1447045 Resource leak

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

In parse_event_rule: Leak of memory or pointers to system resources (CWE-404)

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

src/bin/lttng/commands/add_trigger.c
src/common/uri.c

index 2a7b29d522796c88419fc8b332bcb5b280b45e05..eecda501464c6d07ba96afee6ed3427e8e660dbd 100644 (file)
@@ -789,6 +789,7 @@ end:
        free(filter);
        free(exclude);
        free(loglevel_str);
+       free(source);
        strutils_free_null_terminated_array_of_strings(exclusion_list);
        lttng_kernel_probe_location_destroy(kernel_probe_location);
        lttng_userspace_probe_location_destroy(userspace_probe_location);
index 0f89468c54f3c0f10aa1610df592a6d430a4bd27..d22e56e01f3a563d9b1166e03c472fbd2aa7e7e8 100644 (file)
@@ -514,6 +514,7 @@ end:
        free(addr_f);
 
        *uris = tmp_uris;
+       assert(size == 1 || size == 2);
        return size;
 
 free_error:
This page took 0.02724 seconds and 4 git commands to generate.