diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2014-11-28 12:15:23 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2014-11-28 12:20:04 +0100 |
commit | 313a4081b53c621e1f915491c1c86a58c5b096c1 (patch) | |
tree | b2b62db8e188e6db77c23bd7ae82960f5615dcfd /src/devices | |
parent | 4bf04700bb3d2509d46a9eead4445f674daf0a5a (diff) | |
download | NetworkManager-313a4081b53c621e1f915491c1c86a58c5b096c1.tar.gz |
devices: NM_SETTING_WIRED_S390_SUBCHANNELS is now G_TYPE_STRV (rh #1168764)
Fixes crash on s390.
The type change of the property was done in 6a4127cfa063a77e3ee886a999441c71f6a0e11c,
but we forgot to update this function.
https://bugzilla.redhat.com/show_bug.cgi?id=1168764
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/nm-device-ethernet.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index 541c12c01c..f103c915e3 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -1536,15 +1536,14 @@ update_connection (NMDevice *device, NMConnection *connection) /* s390 */ if (priv->subchannels) { - GPtrArray *subchan_arr = g_ptr_array_sized_new (3); - if (priv->subchan1) - g_ptr_array_add (subchan_arr, priv->subchan1); - if (priv->subchan2) - g_ptr_array_add (subchan_arr, priv->subchan2); - if (priv->subchan3) - g_ptr_array_add (subchan_arr, priv->subchan3); - g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, subchan_arr, NULL); - g_ptr_array_free (subchan_arr, TRUE); + char **subchannels = g_new (char *, 3 + 1); + + subchannels[0] = g_strdup (priv->subchan1); + subchannels[1] = g_strdup (priv->subchan2); + subchannels[2] = g_strdup (priv->subchan3); + subchannels[3] = NULL; + g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, subchannels, NULL); + g_strfreev (subchannels); } if (priv->s390_nettype) g_object_set (s_wired, NM_SETTING_WIRED_S390_NETTYPE, priv->s390_nettype, NULL); |