From e0f4d107bab7aff609fa3e72b104eb78165380f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sun, 14 Feb 2016 17:57:19 -0500 Subject: [PATCH] Fix: string leak when processing of client message fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } /* -- 2.34.1