From d21bb697ad963e8cb60527dae4c8c9eb2f0eb17e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 12 Jan 2021 21:23:03 +0100 Subject: core: avoid "-Wmaybe-uninitialized" warning in lldp_neighbor_get_raw() src/devices/nm-lldp-listener.c: In function 'lldp_neighbor_to_variant': ./shared/nm-glib-aux/nm-shared-utils.h:1271:5: error: 'raw_len' may be used uninitialized in this function [-Werror=maybe-uninitialized] 1271 | g_variant_builder_add(builder, | ^ src/devices/nm-lldp-listener.c:107:19: note: 'raw_len' was declared here 107 | gsize raw_len; | ^ ./shared/nm-glib-aux/nm-shared-utils.h:1271:5: error: 'raw_data' may be used uninitialized in this function [-Werror=maybe-uninitialized] 1271 | g_variant_builder_add(builder, | ^ src/devices/nm-lldp-listener.c:106:19: note: 'raw_data' was declared here 106 | gconstpointer raw_data; | ^ --- src/devices/nm-lldp-listener.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/nm-lldp-listener.c b/src/devices/nm-lldp-listener.c index bd957d9908..e645b9d620 100644 --- a/src/devices/nm-lldp-listener.c +++ b/src/devices/nm-lldp-listener.c @@ -103,8 +103,8 @@ typedef struct { static void lldp_neighbor_get_raw(LldpNeighbor *neigh, const guint8 **out_raw_data, gsize *out_raw_len) { - gconstpointer raw_data; - gsize raw_len; + gconstpointer raw_data = NULL; + gsize raw_len = 0; int r; nm_assert(neigh); -- cgit v1.2.1