X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel.c;h=2031bfb38f4ca3825f37067a2ddbca50890e54f8;hb=7682f30487cfe11af077c668193bb26f587a6081;hp=abf038f4d59a3f1c9f021123e29e947db3fd4db1;hpb=21ed98c107c9be59bd1f4e2b2b1ecfb56ef6ff57;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index abf038f4d..2031bfb38 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -36,6 +36,8 @@ /* * Add context on a kernel channel. + * + * Assumes the ownership of ctx. */ int kernel_add_channel_context(struct ltt_kernel_channel *chan, struct ltt_kernel_context *ctx) @@ -67,7 +69,11 @@ int kernel_add_channel_context(struct ltt_kernel_channel *chan, end: cds_list_add_tail(&ctx->list, &chan->ctx_list); + ctx = NULL; error: + if (ctx) { + trace_kernel_destroy_context(ctx); + } return ret; }