Fix: sessiond: unchecked return value
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 28 Jul 2020 14:26:02 +0000 (10:26 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 29 Jul 2020 16:36:14 +0000 (12:36 -0400)
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 <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Id15632e3932052cf7dce5d57a08ac6efc84fc92f

src/bin/lttng-sessiond/client.c

index 4cfa60067f2ae31a72b2f97b9cce55437d2cdc20..689dc258a604cff0f3d7816f72ff8778523f8cd5 100644 (file)
@@ -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;
This page took 0.032734 seconds and 4 git commands to generate.