From cb1b81ea79adcdc60a2ead88aa787dbbcb2bf422 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 26 Feb 2021 14:06:57 -0500 Subject: [PATCH 1/1] Fix: lttng: add-trigger: leak of error string MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit argpar_state_parse_next allocates an error string on `ARGPAR_STATE_PARSE_NEXT_STATUS_ERROR_UNKNOWN_OPT` which we choose not to handle as an error. Still, the error must be free'd. 1447048 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 Change-Id: Ib4495dedc6273f376f93f9c5e2a26baf1c08e16c --- src/bin/lttng/commands/add_trigger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index bbba2d4d8..74bb2b2aa 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -1114,9 +1114,9 @@ struct lttng_action *handle_action_simple_session( error: lttng_action_destroy(action); action = NULL; - free(error); argpar_item_destroy(item); end: + free(error); return action; } -- 2.34.1