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

src/bin/lttng-sessiond/client.c

index 84a177b9cc814ee868168a40719ed2a02a6763f3..4cfa60067f2ae31a72b2f97b9cce55437d2cdc20 100644 (file)
@@ -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(
This page took 0.034656 seconds and 4 git commands to generate.