# HG changeset patch # User Paul Aurich # Date 1256530888 0 # Node ID e0223ad82ca15fd8f25f648635e4ead2854705af # Parent ac1ad1fa5ecf004d56559c7c5d521962bcd903df account: Don't leak the account->privacy / account->deny lists. Multiple similar to: ==21150== 412 (32 direct, 380 indirect) bytes in 2 blocks are definitely lost in loss record 12,416 of 13,348 ==21150== at 0x4C221A7: malloc (vg_replace_malloc.c:195) ==21150== by 0x90AA552: g_malloc (gmem.c:131) ==21150== by 0x90C03C7: g_slice_alloc (gslice.c:824) ==21150== by 0x90C0E05: g_slist_append (gslist.c:117) ==21150== by 0x93AE56F: purple_privacy_permit_add (privacy.c:58) diff -r ac1ad1fa5ecf -r e0223ad82ca1 libpurple/account.c --- a/libpurple/account.c Mon Oct 26 03:59:55 2009 +0000 +++ b/libpurple/account.c Mon Oct 26 04:21:28 2009 +0000 @@ -1050,6 +1050,16 @@ if(account->system_log) purple_log_free(account->system_log); + while (account->deny) { + g_free(account->deny->data); + account->deny = g_slist_delete_link(account->deny, account->deny); + } + + while (account->permit) { + g_free(account->permit->data); + account->permit = g_slist_delete_link(account->permit, account->permit); + } + priv = PURPLE_ACCOUNT_GET_PRIVATE(account); PURPLE_DBUS_UNREGISTER_POINTER(priv->current_error); if (priv->current_error) {