Fix: session: end goto label used for error path
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 1 Mar 2022 15:23:24 +0000 (10:23 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 1 Mar 2022 19:12:23 +0000 (14:12 -0500)
Reported by Coverity:

    CID 1475801: Unused value (UNUSED_VALUE)
    Assigning value LTTNG_ERR_FATAL to ret_code here, but that stored value is overwritten before it can be used

    CID 1475802: Unused value (UNUSED_VALUE)
    Assigning value LTTNG_ERR_NOMEM to ret_code here, but that stored value is overwritten before it can be used.

    CID 1475814: Unused value (UNUSED_VALUE)
    Assigning value LTTNG_ERR_UST_CHAN_NOT_FOUND to ret_code here, but that stored value is overwritten before it can be used.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I79fb5d65ea0f4f3dfbbef2a42ec3dcf0542043c5

src/bin/lttng-sessiond/cmd.cpp

index ad3bbb387cc2df442d31fcaf9d77ad0c57ccaaf8..659e389b29df286c1d3c7dab2049ce7b5909a48d 100644 (file)
@@ -387,7 +387,7 @@ static enum lttng_error_code list_lttng_ust_global_events(char *channel_name,
        node = lttng_ht_iter_get_node_str(&iter);
        if (node == NULL) {
                ret_code = LTTNG_ERR_UST_CHAN_NOT_FOUND;
-               goto end;
+               goto error;
        }
 
        uchan = caa_container_of(&node->node, struct ltt_ust_channel, node.node);
@@ -420,14 +420,14 @@ static enum lttng_error_code list_lttng_ust_global_events(char *channel_name,
                tmp_event = lttng_event_create();
                if (!tmp_event) {
                        ret_code = LTTNG_ERR_NOMEM;
-                       goto end;
+                       goto error;
                }
 
                if (lttng_strncpy(tmp_event->name, uevent->attr.name,
                                LTTNG_SYMBOL_NAME_LEN)) {
                        ret_code = LTTNG_ERR_FATAL;
                        lttng_event_destroy(tmp_event);
-                       goto end;
+                       goto error;
                }
 
                tmp_event->name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
This page took 0.028886 seconds and 4 git commands to generate.