From e2ca9c32f3e6c246a156d053fdeb2544c4c5fada Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 15 Aug 2007 16:25:48 +0000 Subject: [PATCH] 2007-08-15 Dan Williams * libnm-glib/nm-client.c - (nm_client_get_best_vpn_state): fix leakage of the vpn connection list git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2696 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 5 +++++ libnm-glib/nm-client.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c56182cd77..286776064d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-08-15 Dan Williams + + * libnm-glib/nm-client.c + - (nm_client_get_best_vpn_state): fix leakage of the vpn connection list + 2007-08-15 Tambet Ingo * src/ppp-manager: Implement ppp-manager. It's sort of dead code for now since diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index 8c0b08f1c8..90d94ab7af 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -508,15 +508,17 @@ nm_client_sleep (NMClient *client, gboolean sleep) static NMVPNConnectionState nm_client_get_best_vpn_state (NMClient *client) { - GSList *iter; + GSList *iter, *list; NMVPNConnectionState state; NMVPNConnectionState best_state = NM_VPN_CONNECTION_STATE_UNKNOWN; - for (iter = nm_client_get_vpn_connections (client); iter; iter = iter->next) { + list = nm_client_get_vpn_connections (client); + for (iter = list; iter; iter = iter->next) { state = nm_vpn_connection_get_state (NM_VPN_CONNECTION (iter->data)); if (state > best_state && state < NM_VPN_CONNECTION_STATE_FAILED) best_state = state; } + g_slist_free (list); return best_state; }