diff options
author | Kjartan Maraas <kmaraas@gnome.org> | 2011-03-15 00:08:58 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-03-15 00:08:58 -0500 |
commit | b224ab8e568ab741c78cd03aedab526bbc9c0cd4 (patch) | |
tree | 0bc43ec52a8774411d4cc5ab816abce76f870441 /libnm-glib | |
parent | 925f21f7c27a17d055888104ee954b813c6f53e2 (diff) | |
download | NetworkManager-b224ab8e568ab741c78cd03aedab526bbc9c0cd4.tar.gz |
trivial: let g_free and g_strdup handle NULL (bgo #644763)
Diffstat (limited to 'libnm-glib')
-rw-r--r-- | libnm-glib/nm-access-point.c | 3 | ||||
-rw-r--r-- | libnm-glib/nm-device-ethernet.c | 7 | ||||
-rw-r--r-- | libnm-glib/nm-device-wifi.c | 7 | ||||
-rw-r--r-- | libnm-glib/nm-vpn-connection.c | 4 |
4 files changed, 6 insertions, 15 deletions
diff --git a/libnm-glib/nm-access-point.c b/libnm-glib/nm-access-point.c index e57f078670..2712f36ce1 100644 --- a/libnm-glib/nm-access-point.c +++ b/libnm-glib/nm-access-point.c @@ -508,8 +508,7 @@ finalize (GObject *object) if (priv->ssid) g_byte_array_free (priv->ssid, TRUE); - if (priv->bssid) - g_free (priv->bssid); + g_free (priv->bssid); G_OBJECT_CLASS (nm_access_point_parent_class)->finalize (object); } diff --git a/libnm-glib/nm-device-ethernet.c b/libnm-glib/nm-device-ethernet.c index 6584a3f96c..932c6bda3f 100644 --- a/libnm-glib/nm-device-ethernet.c +++ b/libnm-glib/nm-device-ethernet.c @@ -322,11 +322,8 @@ finalize (GObject *object) { NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object); - if (priv->hw_address) - g_free (priv->hw_address); - - if (priv->perm_hw_address) - g_free (priv->perm_hw_address); + g_free (priv->hw_address); + g_free (priv->perm_hw_address); G_OBJECT_CLASS (nm_device_ethernet_parent_class)->finalize (object); } diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c index c0a366dd93..621c22f183 100644 --- a/libnm-glib/nm-device-wifi.c +++ b/libnm-glib/nm-device-wifi.c @@ -763,11 +763,8 @@ finalize (GObject *object) { NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object); - if (priv->hw_address) - g_free (priv->hw_address); - - if (priv->perm_hw_address) - g_free (priv->perm_hw_address); + g_free (priv->hw_address); + g_free (priv->perm_hw_address); G_OBJECT_CLASS (nm_device_wifi_parent_class)->finalize (object); } diff --git a/libnm-glib/nm-vpn-connection.c b/libnm-glib/nm-vpn-connection.c index c803f120bf..dd219b2a14 100644 --- a/libnm-glib/nm-vpn-connection.c +++ b/libnm-glib/nm-vpn-connection.c @@ -186,9 +186,7 @@ finalize (GObject *object) { NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object); - if (priv->banner) - g_free (priv->banner); - + g_free (priv->banner); g_object_unref (priv->proxy); G_OBJECT_CLASS (nm_vpn_connection_parent_class)->finalize (object); |