X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel.c;h=fb6f96d47f4050edd28b4eb8507aa55993764800;hb=da23da0632799d4a8dba9b25ddc9063dc662c891;hp=e478499336896f5d739e087c8ee91e3a395886cd;hpb=ee4efda9d88ed0eefac33b4ec9dfd41904f9455a;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index e47849933..fb6f96d47 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) @@ -66,9 +68,11 @@ int kernel_add_channel_context(struct ltt_kernel_channel *chan, end: cds_list_add_tail(&ctx->list, &chan->ctx_list); - return 0; - + ctx = NULL; error: + if (ctx) { + trace_kernel_destroy_context(ctx); + } return ret; }