From: Jérémie Galarneau Date: Fri, 31 Jan 2020 21:33:26 +0000 (-0500) Subject: Fix: potential use of uninitialized return value X-Git-Tag: v2.12.0-rc1~17 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=235493868254e943513c6552c6821236284f00ac;p=lttng-tools.git Fix: potential use of uninitialized return value 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 Change-Id: Ia54f5276d6a89d39badfc6c718ad0032edb98ec8 --- diff --git a/src/common/tracker.c b/src/common/tracker.c index 2c91d5d6e..0fdbd60f9 100644 --- a/src/common/tracker.c +++ b/src/common/tracker.c @@ -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;