Fix: lttng-add-context: leak of application context parameters
[lttng-tools.git] / src / bin / lttng / commands / add_context.c
index de066e6dc3410648fff47cb8720ff50ef9885f0c..16389e11398573d71f7c4e81eb61dde06688d4d9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
  * Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * SPDX-License-Identifier: GPL-2.0-only
@@ -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.023757 seconds and 4 git commands to generate.