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;
                     ^
This commit is contained in:
Dan Williams 2017-04-07 11:56:53 -05:00
parent 24ab2a4945
commit f66de1dd0f

View file

@ -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 */