From 2eb1b01fe26f98294e39385df56250ddc58ea9b4 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 28 Jul 2020 10:26:02 -0400 Subject: [PATCH 1/1] Fix: sessiond: unchecked return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit From Coverity: CID 1431048 (#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: Id15632e3932052cf7dce5d57a08ac6efc84fc92f --- src/bin/lttng-sessiond/client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/client.c b/src/bin/lttng-sessiond/client.c index 4cfa60067..689dc258a 100644 --- a/src/bin/lttng-sessiond/client.c +++ b/src/bin/lttng-sessiond/client.c @@ -92,7 +92,11 @@ static int setup_lttng_msg(struct command_ctx *cmd_ctx, .data_size = payload_len, }; - 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; + } + lttng_dynamic_pointer_array_clear(&cmd_ctx->reply_payload._fd_handles); cmd_ctx->lttng_msg_size = total_msg_size; -- 2.34.1