comparison libpurple/protocols/jabber/roster.c @ 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 44b4e8bd759b
children 3de6fbc79134
comparison
equal deleted inserted replaced
20832:c6f601a8eeba 20833:062ed5f59ada
227 227
228 if(jb->subscription == JABBER_SUB_REMOVE) { 228 if(jb->subscription == JABBER_SUB_REMOVE) {
229 remove_purple_buddies(js, jid); 229 remove_purple_buddies(js, jid);
230 } else { 230 } else {
231 GSList *groups = NULL; 231 GSList *groups = NULL;
232 for(group = xmlnode_get_child(item, "group"); group; group = xmlnode_get_next_twin(group)) { 232
233 char *group_name;
234
235 if(!(group_name = xmlnode_get_data(group)))
236 group_name = g_strdup("");
237
238 if (g_slist_find_custom(groups, group_name, (GCompareFunc)purple_utf8_strcasecmp) == NULL)
239 groups = g_slist_append(groups, group_name);
240 }
241 if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER) 233 if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER)
242 if (!jabber_google_roster_incoming(js, item)) 234 if (!jabber_google_roster_incoming(js, item))
243 continue; 235 continue;
236
237 for(group = xmlnode_get_child(item, "group"); group; group = xmlnode_get_next_twin(group)) {
238 char *group_name;
239
240 if(!(group_name = xmlnode_get_data(group)))
241 group_name = g_strdup("");
242
243 if (g_slist_find_custom(groups, group_name, (GCompareFunc)purple_utf8_strcasecmp) == NULL)
244 groups = g_slist_append(groups, group_name);
245 else
246 g_free(group_name);
247 }
244 add_purple_buddies_to_groups(js, jid, name, groups); 248 add_purple_buddies_to_groups(js, jid, name, groups);
245 } 249 }
246 } 250 }
247 251
248 /* if we're just now parsing the roster for the first time, 252 /* if we're just now parsing the roster for the first time,