Fix: unchecked return value of cds_lfht_destroy()
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 31 Jan 2020 23:04:49 +0000 (18:04 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 31 Jan 2020 23:04:49 +0000 (18:04 -0500)
1412202 Unchecked return value

If the function returns an error value, the error value may be
mistaken for a normal value.

In lttng_tracker_list_destroy: Value returned from a function is not
checked for errors before being used (CWE-252)

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I85c994440bc2cd5df0545fd1364dab462f98bc1c

src/bin/lttng-sessiond/tracker.c

index 15779ce722448abbf15403ceeb79a179685594f5..302971767742a41f792f907484e2e91bc10e9c7f 100644 (file)
@@ -225,11 +225,14 @@ end:
 
 void lttng_tracker_list_destroy(struct lttng_tracker_list *tracker_list)
 {
+       int ret;
+
        if (!tracker_list) {
                return;
        }
        lttng_tracker_list_reset(tracker_list);
-       cds_lfht_destroy(tracker_list->ht, NULL);
+       ret = cds_lfht_destroy(tracker_list->ht, NULL);
+       assert(!ret);
        free(tracker_list);
 }
 
This page took 0.034327 seconds and 4 git commands to generate.