From 8608158ed8dc6a8933ffede856f9cee43538d668 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 7 Apr 2017 11:56:53 -0500 Subject: [PATCH] device-bond: fix possible uninitialized variable src/devices/nm-device-bond.c: In function 'check_changed_options': src/devices/nm-device-bond.c:529:4: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized] g_set_error (error, ^ src/devices/nm-device-bond.c:505:14: note: 'name' was declared here const char *name, *value_a, *value_b; ^ src/devices/nm-device-bond.c:528:8: error: 'value_a' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (!nm_streq0 (value_a, value_b)) { ^ src/devices/nm-device-bond.c:505:21: note: 'value_a' was declared here const char *name, *value_a, *value_b; ^ (cherry picked from commit f66de1dd0f44178fa6d0a3940a61e323559dcce6) --- src/devices/nm-device-bond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c index 525291e9ce..bcc9959762 100644 --- a/src/devices/nm-device-bond.c +++ b/src/devices/nm-device-bond.c @@ -502,7 +502,7 @@ static gboolean check_changed_options (NMSettingBond *s_a, NMSettingBond *s_b, GError **error) { guint i, num; - const char *name, *value_a, *value_b; + const char *name = NULL, *value_a = NULL, *value_b = NULL; /* Check that options in @s_a have compatible changes in @s_b */