From: Jérémie Galarneau Date: Thu, 27 Jul 2023 18:59:40 +0000 (-0400) Subject: Fix: lttng-add-context: leak of application context parameters X-Git-Tag: v2.13.11~6 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=087beb4af5384fd841de8c939b65d80e98d4d1dd Fix: lttng-add-context: leak of application context parameters This commit backports 37d11aa60 and ca400a290, see their respective messages. Signed-off-by: Jérémie Galarneau Change-Id: Iaf1c09acda09f592d5b5189ade4b3181e931cd7d --- 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);