X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fagent.c;h=ced0f85cf018c93d5ad1ac9a79a7e6c788ab136c;hp=b2608a186f83095b9faf20fd58a222eb4f2b0283;hb=c12618b52dfd3c5ba932065b32cb5928fe0c2012;hpb=bdf640139afb02572eb23f014e4a61ad68fdfeb1 diff --git a/src/bin/lttng-sessiond/agent.c b/src/bin/lttng-sessiond/agent.c index b2608a186..ced0f85cf 100644 --- a/src/bin/lttng-sessiond/agent.c +++ b/src/bin/lttng-sessiond/agent.c @@ -747,13 +747,14 @@ int agent_enable_context(struct lttng_event_context *ctx, agent_ctx = create_app_ctx(ctx); if (!agent_ctx) { + ret = LTTNG_ERR_NOMEM; goto error_unlock; } /* Enable event on agent application through TCP socket. */ ret = app_context_op(app, agent_ctx, AGENT_CMD_APP_CTX_ENABLE); + destroy_app_ctx(agent_ctx); if (ret != LTTNG_OK) { - destroy_app_ctx(agent_ctx); goto error_unlock; } }