# HG changeset patch # User stefan.becker@nokia.com # Date 1248736464 0 # Node ID b5e52173ef67ec9b42cbe420a2bd7760ba995396 # Parent b6f26015c51c69981f179f2f69d16b6b1240d9bb Free the KeyValuePairs associated with accountopt lists. Closes #9115. Patch from Stefan Becker with minor addition by me. committer: Paul Aurich diff -r b6f26015c51c -r b5e52173ef67 ChangeLog --- a/ChangeLog Mon Jul 27 22:50:34 2009 +0000 +++ b/ChangeLog Mon Jul 27 23:14:24 2009 +0000 @@ -10,7 +10,8 @@ in a group on the buddy list. * Removed the unmaintained and unneeded toc protocol plugin. * Fixed NTLM authentication on big-endian systems. - * Various memory cleanups when unloading libpurple. (Nick Hebner) + * Various memory cleanups when unloading libpurple. (Nick Hebner and + Stefan Becker) * Report idle time 'From last message sent' should work properly. * DNS servers are re-read when DNS queries fail in case the system has moved to a new network and the old servers are not accessible. diff -r b6f26015c51c -r b5e52173ef67 libpurple/accountopt.c --- a/libpurple/accountopt.c Mon Jul 27 22:50:34 2009 +0000 +++ b/libpurple/accountopt.c Mon Jul 27 23:14:24 2009 +0000 @@ -111,6 +111,16 @@ return option; } +static void +purple_account_option_list_free(gpointer data, gpointer user_data) +{ + PurpleKeyValuePair *kvp = data; + + g_free(kvp->value); + g_free(kvp->key); + g_free(kvp); +} + void purple_account_option_destroy(PurpleAccountOption *option) { @@ -127,7 +137,7 @@ { if (option->default_value.list != NULL) { - g_list_foreach(option->default_value.list, (GFunc)g_free, NULL); + g_list_foreach(option->default_value.list, purple_account_option_list_free, NULL); g_list_free(option->default_value.list); } } @@ -183,7 +193,7 @@ if (option->default_value.list != NULL) { - g_list_foreach(option->default_value.list, (GFunc)g_free, NULL); + g_list_foreach(option->default_value.list, purple_account_option_list_free, NULL); g_list_free(option->default_value.list); }