[gnome-control-center] Network: Plug a memory leak



commit 942ff4a9ad0dadff615fa6af67cf8e12aedddfe1
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 25 20:12:08 2011 -0400

    Network: Plug a memory leak

 panels/network/cc-network-panel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index f1c3023..df5527e 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -1980,6 +1980,7 @@ wireless_ap_changed_cb (GtkComboBox *combo_box, CcNetworkPanel *panel)
         gchar *object_path = NULL;
         gchar *ssid_target = NULL;
         GSList *list, *l;
+        GSList *filtered;
         GtkTreeIter iter;
         GtkTreeModel *model;
         NetObject *object;
@@ -2016,10 +2017,10 @@ wireless_ap_changed_cb (GtkComboBox *combo_box, CcNetworkPanel *panel)
         list = nm_remote_settings_list_connections (panel->priv->remote_settings);
         g_debug ("%i existing remote connections available",
                  g_slist_length (list));
-        list = nm_device_filter_connections (device, list);
+        filtered = nm_device_filter_connections (device, list);
         g_debug ("%i suitable remote connections to check",
-                 g_slist_length (list));
-        for (l = list; l; l = g_slist_next (l)) {
+                 g_slist_length (filtered));
+        for (l = filtered; l; l = g_slist_next (l)) {
                 connection = NM_CONNECTION (l->data);
                 setting_wireless = nm_connection_get_setting_wireless (connection);
                 if (!NM_IS_SETTING_WIRELESS (setting_wireless))
@@ -2036,6 +2037,9 @@ wireless_ap_changed_cb (GtkComboBox *combo_box, CcNetworkPanel *panel)
                 }
         }
 
+        g_slist_free (list);
+        g_slist_free (filtered);
+
         /* activate the connection */
         if (connection_activate != NULL) {
                 nm_client_activate_connection (panel->priv->client,



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