summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-01-12 21:23:03 +0100
committerThomas Haller <thaller@redhat.com>2021-01-12 21:49:21 +0100
commitd21bb697ad963e8cb60527dae4c8c9eb2f0eb17e (patch)
tree9e65b7d84d7de5f6d12e483d78d037d67a015d1c
parentf16f428b313df3ee546a55699761a21fa01947d3 (diff)
downloadNetworkManager-d21bb697ad963e8cb60527dae4c8c9eb2f0eb17e.tar.gz
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; | ^
-rw-r--r--src/devices/nm-lldp-listener.c4
1 files 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);