From d030019245733e821bbd0b3451bb732be19e4e84 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 6 Oct 2007 04:24:30 +0000 Subject: [PATCH] 2007-10-06 Dan Williams * libnm-glib/nm-device-802-11-wireless.c - (nm_device_802_11_wireless_get_active_access_point): don't segfault on error when getting the active access point over D-Bus from NM git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2939 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 6 ++++++ libnm-glib/nm-device-802-11-wireless.c | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3489114a64..7f1a71759e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-10-06 Dan Williams + + * libnm-glib/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_get_active_access_point): don't segfault + on error when getting the active access point over D-Bus from NM + 2007-10-05 Dan Williams * libnm-util/nm-setting.c diff --git a/libnm-glib/nm-device-802-11-wireless.c b/libnm-glib/nm-device-802-11-wireless.c index b0bd281029..5ef1804e53 100644 --- a/libnm-glib/nm-device-802-11-wireless.c +++ b/libnm-glib/nm-device-802-11-wireless.c @@ -495,10 +495,12 @@ nm_device_802_11_wireless_get_active_access_point (NMDevice80211Wireless *device path = nm_object_get_object_path_property (NM_OBJECT (device), NM_DBUS_INTERFACE_DEVICE_WIRELESS, DBUS_PROP_ACTIVE_ACCESS_POINT); - priv->current_ap = get_access_point (device, path, TRUE); - if (priv->current_ap) - g_object_ref (priv->current_ap); - g_free (path); + if (path) { + priv->current_ap = get_access_point (device, path, TRUE); + if (priv->current_ap) + g_object_ref (priv->current_ap); + g_free (path); + } } return priv->current_ap;