changeset 20833:062ed5f59ada

Fix a couple leaks in parsing the xmpp roster.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 08 Oct 2007 20:46:00 +0000
parents c6f601a8eeba
children 6b9e5bbab0fe
files libpurple/protocols/jabber/roster.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);
 		}
 	}