Fix: potential use of uninitialized return value
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 31 Jan 2020 21:33:26 +0000 (16:33 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 31 Jan 2020 21:33:26 +0000 (16:33 -0500)
lttng_tracker_ids_serialize() can return an uninitialized value
when 0 ids are being tracked by a tracker. This is not currently
reachable, but generates a warning on some compilers.

'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

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

src/common/tracker.c

index 2c91d5d6ebd45c6991a421a5aff2897c15a55fb6..0fdbd60f9eaacce380478be6b3dc9b68e77b3944 100644 (file)
@@ -300,7 +300,7 @@ void lttng_tracker_ids_destroy(struct lttng_tracker_ids *ids)
 int lttng_tracker_ids_serialize(const struct lttng_tracker_ids *ids,
                struct lttng_dynamic_buffer *buffer)
 {
-       int ret;
+       int ret = 0;
        int value;
        const char *string;
        unsigned int count;
This page took 0.036945 seconds and 4 git commands to generate.