Mercurial > pidgin
changeset 6794:ab5dd35443c6
[gaim-migrate @ 7333]
let's not access memory after it's free'd, ok?
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Mon, 08 Sep 2003 18:54:20 +0000 |
parents | 3d84c933b939 |
children | 40ba19133882 |
files | src/blist.c |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/blist.c Mon Sep 08 10:08:39 2003 +0000 +++ b/src/blist.c Mon Sep 08 18:54:20 2003 +0000 @@ -593,11 +593,8 @@ bnode->next->prev = bnode->prev; if(bnode->prev) bnode->prev->next = bnode->next; - if(bnode->parent->child == bnode) { + if(bnode->parent->child == bnode) bnode->parent->child = bnode->next; - if(!bnode->parent->child) - gaim_blist_remove_contact((GaimContact*)bnode->parent); - } ops->remove(gaimbuddylist, bnode); @@ -611,6 +608,10 @@ g_hash_table_remove(gaimbuddylist->buddies, hb); g_free(hb); } + + if(!bnode->parent->child) + gaim_blist_remove_contact((GaimContact*)bnode->parent); + } if(node && GAIM_BLIST_NODE_IS_BUDDY(node)) {