From 087beb4af5384fd841de8c939b65d80e98d4d1dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 27 Jul 2023 14:59:40 -0400 Subject: [PATCH] Fix: lttng-add-context: leak of application context parameters MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This commit backports 37d11aa60 and ca400a290, see their respective messages. Signed-off-by: Jérémie Galarneau Change-Id: Iaf1c09acda09f592d5b5189ade4b3181e931cd7d --- src/bin/lttng/commands/add_context.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c index c2614f2a2..16389e113 100644 --- a/src/bin/lttng/commands/add_context.c +++ b/src/bin/lttng/commands/add_context.c @@ -871,6 +871,10 @@ void destroy_ctx_type(struct ctx_type *type) } if (type->opt) { free(type->opt->symbol); + if (type->opt->ctx_type == CONTEXT_APP_CONTEXT) { + free(type->opt->u.app_ctx.ctx_name); + free(type->opt->u.app_ctx.provider_name); + } } free(type->opt); free(type); -- 2.34.1