From 64defc29e677a20a8ed00d55d9884a77bdc893d2 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 28 Jul 2020 10:15:04 -0400 Subject: [PATCH] Fix: sessiond: unchecked return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng-sessiond/client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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( -- 2.34.1