diff src/list.c @ 4721:91ef4fae4a49

[gaim-migrate @ 5033] plug a leak or two, and make removing buddies not blow up. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 12 Mar 2003 02:27:28 +0000
parents 06e8e5858121
children e4a8c7215fdf
line wrap: on
line diff
--- a/src/list.c	Wed Mar 12 01:34:25 2003 +0000
+++ b/src/list.c	Wed Mar 12 02:27:28 2003 +0000
@@ -296,13 +296,21 @@
 {
 	struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops;
 
-	GaimBlistNode *node = (GaimBlistNode*)buddy;
-	
+	GaimBlistNode *gnode, *node = (GaimBlistNode*)buddy;
+	struct group *group;
+
+	gnode = node->parent;
+	group = (struct group *)gnode;
+
+	if(gnode->child == node)
+		gnode->child = node->next;
 	if (node->prev)
 		node->prev->next = node->next;
 	if (node->next)
 		node->next->prev = node->prev;
-	
+
+	group->members = g_slist_remove(group->members, buddy);
+
 	ops->remove(gaimbuddylist, node);
 	g_free(buddy->name);
 	g_free(buddy->alias);