summaryrefslogtreecommitdiff
path: root/libnm/nm-device-bridge.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-10-06 21:16:00 -0400
committerDan Winship <danw@gnome.org>2014-10-19 09:26:49 -0400
commitab878f7479245fbb8c98d17e0f963afc0a163be7 (patch)
tree8d5a043600ecefcc3b0533bc8379be670d124e04 /libnm/nm-device-bridge.c
parent88efa1c4376b7fc55bf2ba9bf74ddbecb4ed5075 (diff)
downloadNetworkManager-ab878f7479245fbb8c98d17e0f963afc0a163be7.tar.gz
libnm: further NULL-vs-empty-array fixes
In some cases, code may look at the value of an array-valued property during object initialization, before NMObject has set it to its actual initial value. So ensure that we initialize all such properties to an empty array, rather than leaving them NULL. Also fix another bug in NMClient that could result in priv->active_connections being NULL during certain signal emissions, and fix nm_client_get_active_connections() to not return NULL when NM was not running.
Diffstat (limited to 'libnm/nm-device-bridge.c')
-rw-r--r--libnm/nm-device-bridge.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libnm/nm-device-bridge.c b/libnm/nm-device-bridge.c
index b4ee25b811..63d9040d49 100644
--- a/libnm/nm-device-bridge.c
+++ b/libnm/nm-device-bridge.c
@@ -173,7 +173,11 @@ get_hw_address (NMDevice *device)
static void
nm_device_bridge_init (NMDeviceBridge *device)
{
+ NMDeviceBridgePrivate *priv = NM_DEVICE_BRIDGE_GET_PRIVATE (device);
+
_nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_BRIDGE);
+
+ priv->slaves = g_ptr_array_new ();
}
static void