diff plugins/idle.c @ 13833:571aebbe5ec6

[gaim-migrate @ 16282] SF Patch #1502594 from Yosef Radchenko "Patches three instances of memory leaks with gaim_accounts_get_all_active" committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 19 Jun 2006 05:39:30 +0000
parents 85267a333422
children
line wrap: on
line diff
--- a/plugins/idle.c	Mon Jun 19 05:17:54 2006 +0000
+++ b/plugins/idle.c	Mon Jun 19 05:39:30 2006 +0000
@@ -102,12 +102,13 @@
 idle_all_action_ok(void *ignored, GaimRequestFields *fields)
 {
 	GaimAccount *acct = NULL;
-	GList *l = gaim_accounts_get_all_active();
+	GList *list, *iter;
 	int tm = gaim_request_fields_get_integer(fields, "mins");
 	const char *prpl_id = NULL;
 
-	for(; l; l = l->next) {
-		acct = (GaimAccount *)(l->data);
+	list = gaim_accounts_get_all_active();
+	for(iter = list; iter; iter = iter->next) {
+		acct = (GaimAccount *)(iter->data);
 
 		if(acct)
 			prpl_id = gaim_account_get_protocol_id(acct);
@@ -122,6 +123,8 @@
 				idled_accts = g_list_append(idled_accts, acct);
 		}
 	}
+
+	g_list_free(list);
 }
 
 static void