From 313a4081b53c621e1f915491c1c86a58c5b096c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 28 Nov 2014 12:15:23 +0100 Subject: [PATCH] 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 --- src/devices/nm-device-ethernet.c | 17 ++++++++--------- 1 file 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);