Fix a couple leaks in parsing the xmpp roster.

Mon, 08 Oct 2007 20:46:00 +0000

author
Daniel Atallah <datallah@pidgin.im>
date
Mon, 08 Oct 2007 20:46:00 +0000
changeset 20911
554739ed406e
parent 20910
e2202cc3f125
child 20912
ef52cd4f525e

Fix a couple leaks in parsing the xmpp roster.

libpurple/protocols/jabber/roster.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/jabber/roster.c	Mon Oct 08 15:34:58 2007 +0000
+++ b/libpurple/protocols/jabber/roster.c	Mon Oct 08 20:46:00 2007 +0000
@@ -229,6 +229,11 @@
 			remove_purple_buddies(js, jid);
 		} else {
 			GSList *groups = NULL;
+
+			if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER)
+				if (!jabber_google_roster_incoming(js, item))
+					continue;
+
 			for(group = xmlnode_get_child(item, "group"); group; group = xmlnode_get_next_twin(group)) {
 				char *group_name;
 
@@ -237,10 +242,9 @@
 
 				if (g_slist_find_custom(groups, group_name, (GCompareFunc)purple_utf8_strcasecmp) == NULL)
 					groups = g_slist_append(groups, group_name);
+				else
+					g_free(group_name);
 			}
-			if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER)
-				if (!jabber_google_roster_incoming(js, item))
-					continue;
 			add_purple_buddies_to_groups(js, jid, name, groups);
 		}
 	}

mercurial