# HG changeset patch # User Daniel Atallah # Date 1171901365 0 # Node ID 6eda87b08cdf213239f37b6e2a388d58cc722aa5 # Parent 95c4dee525f0c566e80a847d4f6d5e080bbc76e6 Don't access the list element after it has been freed. diff -r 95c4dee525f0 -r 6eda87b08cdf libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Mon Feb 19 16:08:43 2007 +0000 +++ b/libpurple/protocols/jabber/buddy.c Mon Feb 19 16:09:25 2007 +0000 @@ -602,11 +602,11 @@ /* Remove the timeout, which would otherwise trigger jabber_buddy_get_info_timeout() */ if (jbi->timeout_handle > 0) gaim_timeout_remove(jbi->timeout_handle); - + g_free(jbi->jid); g_hash_table_destroy(jbi->resources); g_free(jbi->vcard_text); - g_free(jbi); + g_free(jbi); } static void jabber_buddy_info_show_if_ready(JabberBuddyInfo *jbi) @@ -694,7 +694,7 @@ gaim_notify_user_info_add_pair(user_info, _("Client"), tmp); g_free(tmp); - + if(jbr->client.os) { gaim_notify_user_info_add_pair(user_info, _("Operating System"), jbr->client.os); } @@ -726,14 +726,16 @@ static void jabber_buddy_info_remove_id(JabberBuddyInfo *jbi, const char *id) { GSList *l = jbi->ids; + char *comp_id; if(!id) return; while(l) { - if(!strcmp(id, l->data)) { - jbi->ids = g_slist_remove(jbi->ids, l->data); - g_free(l->data); + comp_id = l->data; + if(!strcmp(id, comp_id)) { + jbi->ids = g_slist_remove(jbi->ids, comp_id); + g_free(comp_id); return; } l = l->next; @@ -1093,7 +1095,7 @@ g_slist_free(jbi->ids); jabber_buddy_info_destroy(jbi); - l = l->next; + l = l->next; } g_slist_free(js->pending_buddy_info_requests);