From 5b2aea3d63da343ca2f365ccb40b99f2e665f0e1 Mon Sep 17 00:00:00 2001 From: Tambet Ingo Date: Tue, 6 May 2008 07:59:30 +0000 Subject: [PATCH] 2008-05-06 Tambet Ingo * libnm-glib/nm-dbus-settings.c (fetch_connections_done): Don't leak the returned connection paths. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3633 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 5 +++++ libnm-glib/nm-dbus-settings.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41b34ba519..015ed02942 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-06 Tambet Ingo + + * libnm-glib/nm-dbus-settings.c (fetch_connections_done): Don't leak + the returned connection paths. + 2008-05-05 Tambet Ingo * libnm-glib/nm-dbus-settings.c (constructor): Fix the diff --git a/libnm-glib/nm-dbus-settings.c b/libnm-glib/nm-dbus-settings.c index 868eca0ddc..952d4d5666 100644 --- a/libnm-glib/nm-dbus-settings.c +++ b/libnm-glib/nm-dbus-settings.c @@ -89,8 +89,12 @@ fetch_connections_done (DBusGProxy *proxy, if (!err) { int i; - for (i = 0; i < connections->len; i++) - new_connection_cb (proxy, g_ptr_array_index (connections, i), user_data); + for (i = 0; i < connections->len; i++) { + char *path = g_ptr_array_index (connections, i); + + new_connection_cb (proxy, path, user_data); + g_free (path); + } } else { g_warning ("Could not retrieve dbus connections: %s.", err->message); g_error_free (err);