From: Jonathan Rajotte Date: Tue, 28 Jul 2020 14:15:04 +0000 (-0400) Subject: Fix: sessiond: unchecked return value X-Git-Tag: v2.13.0-rc1~560 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=64defc29e677a20a8ed00d55d9884a77bdc893d2;p=lttng-tools.git Fix: sessiond: unchecked return value From coverity: CID 1431054 (#1 of 1): Unchecked return value (CHECKED_RETURN) 1. check_return: Calling lttng_dynamic_buffer_set_size without checking return value (as is done elsewhere 32 out of 40 times). Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I6b5b18d90f194c8081b91b3fbb80dccd29ba19ca --- diff --git a/src/bin/lttng-sessiond/client.c b/src/bin/lttng-sessiond/client.c index 84a177b9c..4cfa60067 100644 --- a/src/bin/lttng-sessiond/client.c +++ b/src/bin/lttng-sessiond/client.c @@ -133,7 +133,10 @@ static int setup_empty_lttng_msg(struct command_ctx *cmd_ctx) int ret; const struct lttcomm_lttng_msg llm = {}; - lttng_dynamic_buffer_set_size(&cmd_ctx->reply_payload.buffer, 0); + ret = lttng_dynamic_buffer_set_size(&cmd_ctx->reply_payload.buffer, 0); + if (ret) { + goto end; + } /* Append place-holder reply header. */ ret = lttng_dynamic_buffer_append(