From: Jérémie Galarneau Date: Sun, 14 Feb 2016 22:57:19 +0000 (-0500) Subject: Fix: string leak when processing of client message fails X-Git-Tag: v2.8.0-rc1~163 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e0f4d107bab7aff609fa3e72b104eb78165380f8;p=lttng-tools.git Fix: string leak when processing of client message fails Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 7a8b5ae42..c8989113a 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -3369,12 +3369,16 @@ skip_domain: ret = -LTTNG_ERR_NOMEM; goto error; } + cmd_ctx->lsm->u.context.ctx.u.app_ctx.provider_name = + provider_name; context_name = zmalloc(context_name_len + 1); if (!context_name) { ret = -LTTNG_ERR_NOMEM; goto error_add_context; } + cmd_ctx->lsm->u.context.ctx.u.app_ctx.ctx_name = + context_name; ret = lttcomm_recv_unix_sock(sock, provider_name, provider_name_len); @@ -3387,10 +3391,6 @@ skip_domain: if (ret < 0) { goto error_add_context; } - cmd_ctx->lsm->u.context.ctx.u.app_ctx.provider_name = - provider_name; - cmd_ctx->lsm->u.context.ctx.u.app_ctx.ctx_name = - context_name; } /*