Fix: lttng: add-trigger: leak of argpar_item
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 26 Feb 2021 18:47:22 +0000 (13:47 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 4 Mar 2021 16:59:19 +0000 (11:59 -0500)
1447047 Resource leak

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

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

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

src/bin/lttng/commands/add_trigger.c

index 9d013122d76a812038ef369798f289b6aebaf995..2a7b29d522796c88419fc8b332bcb5b280b45e05 100644 (file)
@@ -1114,6 +1114,7 @@ error:
        lttng_action_destroy(action);
        action = NULL;
        free(error);
        lttng_action_destroy(action);
        action = NULL;
        free(error);
+       argpar_item_destroy(item);
 end:
        return action;
 }
 end:
        return action;
 }
@@ -1440,6 +1441,7 @@ end:
        free(data_url_arg);
        free(snapshot_output);
        argpar_state_destroy(state);
        free(data_url_arg);
        free(snapshot_output);
        argpar_state_destroy(state);
+       argpar_item_destroy(item);
        return action;
 }
 
        return action;
 }
 
This page took 0.025482 seconds and 4 git commands to generate.