X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel.c;h=2cbed381870a096350a4e8ac77ec39845850d0f1;hb=710509e664f62d71a215d5185e5bf89a6879672e;hp=abf038f4d59a3f1c9f021123e29e947db3fd4db1;hpb=1cacb1214f55b04498457455ac25465f1f0cc6c1;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index abf038f4d..2cbed3818 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,12 @@ int kernel_add_channel_context(struct ltt_kernel_channel *chan, end: cds_list_add_tail(&ctx->list, &chan->ctx_list); + ctx->in_list = true; + ctx = NULL; error: + if (ctx) { + trace_kernel_destroy_context(ctx); + } return ret; }