X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fadd_context.c;h=16389e11398573d71f7c4e81eb61dde06688d4d9;hb=087beb4af5384fd841de8c939b65d80e98d4d1dd;hp=b33eb1d14ef22545b73baeceed6d6a19424b9e8c;hpb=d37ac3cdc4fe21f117edfb829db4d0eb7cf914a1;p=lttng-tools.git diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c index b33eb1d14..16389e113 100644 --- a/src/bin/lttng/commands/add_context.c +++ b/src/bin/lttng/commands/add_context.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 David Goulet + * Copyright (C) 2011 EfficiOS Inc. * Copyright (C) 2016 Jérémie Galarneau * * SPDX-License-Identifier: GPL-2.0-only @@ -19,6 +19,7 @@ #include +#include #include #include "../command.h" @@ -810,11 +811,13 @@ static int add_context(char *session_name) } else { if (opt_channel_name) { MSG("%s context %s added to channel %s", - get_domain_str(dom.type), type->opt->symbol, + lttng_domain_type_str(dom.type), + type->opt->symbol, opt_channel_name); } else { MSG("%s context %s added to all channels", - get_domain_str(dom.type), type->opt->symbol); + lttng_domain_type_str(dom.type), + type->opt->symbol); } success = 1; } @@ -868,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);