[gnome-control-center] network: Plug memory leaks



commit b5335bf2e707821d5a171b4886c30c32854b24d7
Author: Thomas Bechtold <thomasbechtold jpberlin de>
Date:   Fri Feb 15 13:22:07 2013 +0100

    network: Plug memory leaks
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693879

 panels/network/cc-network-panel.c    |    1 +
 panels/network/net-device-ethernet.c |    2 ++
 panels/network/net-device-wifi.c     |    2 ++
 panels/network/net-object.c          |    2 ++
 4 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 94ab9ed..b276b96 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -1202,6 +1202,7 @@ notify_connections_read_cb (NMRemoteSettings *settings,
                 connection = NM_CONNECTION (iter->data);
                 add_connection (panel, connection);
         }
+        g_slist_free (list);
 }
 
 static gboolean
diff --git a/panels/network/net-device-ethernet.c b/panels/network/net-device-ethernet.c
index cb3be6d..addaf4b 100644
--- a/panels/network/net-device-ethernet.c
+++ b/panels/network/net-device-ethernet.c
@@ -420,6 +420,8 @@ populate_ui (NetDeviceEthernet *device)
                 gtk_widget_hide (device->details);
                 gtk_widget_hide (device->details_button);
         }
+
+        g_slist_free (connections);
 }
 
 static void
diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c
index 8d2bf22..34dcd9d 100644
--- a/panels/network/net-device-wifi.c
+++ b/panels/network/net-device-wifi.c
@@ -1790,6 +1790,7 @@ open_history (NetDeviceWifi *device_wifi)
                 }
         }
         g_slist_free (connections);
+        g_ptr_array_free (aps_unique, TRUE);
 
         gtk_window_present (GTK_WINDOW (dialog));
 }
@@ -1866,6 +1867,7 @@ populate_ap_list (NetDeviceWifi *device_wifi)
         }
 
         g_slist_free (connections);
+        g_ptr_array_free (aps_unique, TRUE);
 }
 
 static void
diff --git a/panels/network/net-object.c b/panels/network/net-object.c
index 24a345e..573dc97 100644
--- a/panels/network/net-object.c
+++ b/panels/network/net-object.c
@@ -87,6 +87,7 @@ void
 net_object_set_id (NetObject *object, const gchar *id)
 {
         g_return_if_fail (NET_IS_OBJECT (object));
+        g_clear_pointer (&object->priv->id, g_free);
         object->priv->id = g_strdup (id);
         g_object_notify (G_OBJECT (object), "id");
 }
@@ -109,6 +110,7 @@ void
 net_object_set_title (NetObject *object, const gchar *title)
 {
         g_return_if_fail (NET_IS_OBJECT (object));
+        g_clear_pointer (&object->priv->title, g_free);
         object->priv->title = g_strdup (title);
         g_object_notify (G_OBJECT (object), "title");
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]