changeset 20835:3de6fbc79134

Another couple leak fixes in the xmpp roster parsing.
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 09 Oct 2007 00:25:56 +0000
parents 6b9e5bbab0fe
children d1e3e1bbb242
files libpurple/protocols/jabber/roster.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/roster.c	Tue Oct 09 00:24:45 2007 +0000
+++ b/libpurple/protocols/jabber/roster.c	Tue Oct 09 00:25:56 2007 +0000
@@ -67,8 +67,10 @@
 	if(!groups) {
 		if(!buddies)
 			g2 = g_slist_append(g2, g_strdup(_("Buddies")));
-		else
+		else {
+			g_slist_free(buddies);
 			return;
+		}
 	}
 
 	my_bare_jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain);
@@ -267,6 +269,9 @@
 	JabberIq *iq;
 	xmlnode *query, *item, *group;
 
+	if(!(b = purple_find_buddy(js->gc->account, name)))
+		return;
+
 	if(grps) {
 		groups = grps;
 	} else {
@@ -281,9 +286,6 @@
 		}
 	}
 
-	if(!(b = purple_find_buddy(js->gc->account, name)))
-		return;
-
 	iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:roster");
 
 	query = xmlnode_get_child(iq->node, "query");