# HG changeset patch # User Daniel Atallah # Date 1192423613 0 # Node ID dd0878ccc57706c2733c14d33a70d07ec26136cf # Parent 128aca651b9a069890e90f2bdc7e1c4659a58c61 Clarify the documentation for purple_notify_user_info_remove_entry() to indicated that it doesn't free the removed entry. Make purple_notify_user_info_remove_last_item() free the entry it is removing as that is the only sensible thing to do (otherwise purple_notify_user_info_remove_entry() should have been used instead). This fixes leakage in the msn prpl. diff -r 128aca651b9a -r dd0878ccc577 libpurple/notify.c --- a/libpurple/notify.c Mon Oct 15 04:42:44 2007 +0000 +++ b/libpurple/notify.c Mon Oct 15 04:46:53 2007 +0000 @@ -688,8 +688,11 @@ void purple_notify_user_info_remove_last_item(PurpleNotifyUserInfo *user_info) { - user_info->user_info_entries = g_list_remove(user_info->user_info_entries, - g_list_last(user_info->user_info_entries)->data); + GList *last = g_list_last(user_info->user_info_entries); + if (last) { + purple_notify_user_info_entry_destroy(last->data); + user_info->user_info_entries = g_list_remove_link(user_info->user_info_entries, last); + } } void * diff -r 128aca651b9a -r dd0878ccc577 libpurple/notify.h --- a/libpurple/notify.h Mon Oct 15 04:42:44 2007 +0000 +++ b/libpurple/notify.h Mon Oct 15 04:46:53 2007 +0000 @@ -539,7 +539,7 @@ void purple_notify_user_info_prepend_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value); /** - * Remove a PurpleNotifyUserInfoEntry from a PurpleNotifyUserInfo object + * Remove a PurpleNotifyUserInfoEntry from a PurpleNotifyUserInfo object without freeing the entry. * * @param user_info The PurpleNotifyUserInfo * @param user_info_entry The PurpleNotifyUserInfoEntry