# HG changeset patch # User Richard Laager # Date 1141698097 0 # Node ID b53fe4fa46b6ba1d27cc007e239e25c617955380 # Parent 2ec69a9763a5f86595c1604bebb52ac3b704ea26 [gaim-migrate @ 15797] CID 15 lists an ops->update() call that isn't guarded. I search this whole file and found and fixed a couple more. Resolves CID 15 committer: Tailor Script diff -r 2ec69a9763a5 -r b53fe4fa46b6 src/blist.c --- a/src/blist.c Tue Mar 07 02:15:36 2006 +0000 +++ b/src/blist.c Tue Mar 07 02:21:37 2006 +0000 @@ -1198,7 +1198,8 @@ if (cnode->parent->child == cnode) cnode->parent->child = cnode->next; - ops->remove(gaimbuddylist, cnode); + if (ops && ops->remove) + ops->remove(gaimbuddylist, cnode); /* ops->remove() cleaned up the cnode's ui_data, so we need to * reinitialize it */ ops->new_node(cnode); @@ -1302,7 +1303,8 @@ if (bnode->parent->child == bnode) bnode->parent->child = bnode->next; - ops->remove(gaimbuddylist, bnode); + if (ops && ops->remove) + ops->remove(gaimbuddylist, bnode); gaim_blist_schedule_save(); @@ -1320,7 +1322,8 @@ gaim_blist_remove_contact((GaimContact*)bnode->parent); } else { gaim_contact_invalidate_priority_buddy((GaimContact*)bnode->parent); - ops->update(gaimbuddylist, bnode->parent); + if (ops && ops->update) + ops->update(gaimbuddylist, bnode->parent); } } @@ -1557,7 +1560,8 @@ ((GaimGroup*)cnode->parent)->currentsize--; ((GaimGroup*)cnode->parent)->totalsize--; - ops->remove(gaimbuddylist, cnode); + if (ops && ops->remove) + ops->remove(gaimbuddylist, cnode); gaim_blist_schedule_save(); } @@ -1587,11 +1591,14 @@ gaim_blist_schedule_save(); - if (ops && cnode->child) - ops->update(gaimbuddylist, cnode); - - for (bnode = cnode->child; bnode; bnode = bnode->next) - ops->update(gaimbuddylist, bnode); + if (ops && ops->update) + { + if (cnode->child) + ops->update(gaimbuddylist, cnode); + + for (bnode = cnode->child; bnode; bnode = bnode->next) + ops->update(gaimbuddylist, bnode); + } } void gaim_blist_merge_contact(GaimContact *source, GaimBlistNode *node) @@ -1652,7 +1659,8 @@ if (gaim_find_group(group->name)) { /* This is just being moved */ - ops->remove(gaimbuddylist, (GaimBlistNode *)group); + if (ops && ops->remove) + ops->remove(gaimbuddylist, (GaimBlistNode *)group); if (gnode == gaimbuddylist->root) gaimbuddylist->root = gnode->next;