X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel.c;h=2031bfb38f4ca3825f37067a2ddbca50890e54f8;hp=abf038f4d59a3f1c9f021123e29e947db3fd4db1;hb=df3c77c8dbbd102718f7149b075ba026d70a9e27;hpb=55d7bb027104ac0afd80be872e0ff7ebb832216e 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; }