From 856a1c6b2c9437ac03d210f5b7ecd0d08da71fcd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 29 Oct 2010 14:01:22 -0500 Subject: [PATCH] ifnet: fix memory leak --- system-settings/plugins/ifnet/net_parser.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/system-settings/plugins/ifnet/net_parser.c b/system-settings/plugins/ifnet/net_parser.c index 79084ff881..98cfc2f1bd 100644 --- a/system-settings/plugins/ifnet/net_parser.c +++ b/system-settings/plugins/ifnet/net_parser.c @@ -404,17 +404,18 @@ ifnet_get_global_data (const gchar * key) // Return names of legal connections GList * -ifnet_get_connection_names () +ifnet_get_connection_names (void) { GList *names = g_hash_table_get_keys (conn_table); GList *result = NULL; while (names) { if (!ignore_connection_name (names->data)) - result = g_list_append (result, names->data); + result = g_list_prepend (result, names->data); names = names->next; } - return result; + g_list_free (names); + return g_list_reverse (result); } /* format IP and route for writing */