Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
end:
cds_list_add_tail(&ctx->list, &chan->ctx_list);
+ ctx->in_list = true;
ctx = NULL;
error:
if (ctx) {
{
assert(ctx);
- cds_list_del(&ctx->list);
+ if (ctx->in_list) {
+ cds_list_del(&ctx->list);
+ }
free(ctx);
}
struct ltt_kernel_context {
struct lttng_kernel_context ctx;
struct cds_list_head list;
+ /* Indicates whether or not the context is in a list. */
+ bool in_list;
};
/* Kernel event */