Fix: lttng-add-context: leak of application context parameters
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 27 Jul 2023 18:59:40 +0000 (14:59 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 27 Jul 2023 18:59:40 +0000 (14:59 -0400)
This commit backports 37d11aa60 and ca400a290, see their respective
messages.

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

src/bin/lttng/commands/add_context.c

index c2614f2a2d023b8d20b4b98f64f8533844834653..16389e11398573d71f7c4e81eb61dde06688d4d9 100644 (file)
@@ -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);
This page took 0.025728 seconds and 4 git commands to generate.