X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel.c;h=8dc3f86314d5aab8b94bf623942ec1ee404ad959;hb=f712b0897400a37cf3fa9abdbc11aa00df1e6993;hp=78978a234a6d8cf53b5011aaf728340462b3206c;hpb=a2d808db82a77a9b5133f1aaee2de32d7f990fbc;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index 78978a234..8dc3f8631 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -37,6 +37,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,9 +69,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; }