pidgin/pidgin

Parents d96f03bbc4e6
Children 2acee98e6c25
Use g_slist_free_full and g_list_free_full in a few places.
--- a/libpurple/protocols/oscar/family_icq.c Mon Jan 20 10:15:55 2014 -0800
+++ b/libpurple/protocols/oscar/family_icq.c Mon Jan 20 10:23:02 2014 -0800
@@ -771,10 +771,7 @@
static void
icq_shutdown(OscarData *od, aim_module_t *mod)
{
- GSList *cur;
- for (cur = od->icq_info; cur; cur = cur->next)
- aim_icq_freeinfo(cur->data);
- g_slist_free(od->icq_info);
+ g_slist_free_full(od->icq_info, aim_icq_freeinfo);
}
int
--- a/libpurple/protocols/yahoo/libymsg.c Mon Jan 20 10:15:55 2014 -0800
+++ b/libpurple/protocols/yahoo/libymsg.c Mon Jan 20 10:23:02 2014 -0800
@@ -3822,10 +3822,7 @@
}
g_slist_free(yd->confs);
- for (l = yd->cookies; l; l = l->next) {
- g_free(l->data);
- }
- g_slist_free(yd->cookies);
+ g_slist_free_full(yd->cookies, g_free);
yd->chat_online = FALSE;
if (yd->in_chat)
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Mon Jan 20 10:15:55 2014 -0800
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Mon Jan 20 10:23:02 2014 -0800
@@ -64,7 +64,6 @@
PurpleConnection *gc;
YahooData *yd;
PurpleXfer *xfer;
- GSList *l;
gc = xd->gc;
yd = purple_connection_get_protocol_data(gc);
@@ -76,17 +75,8 @@
g_hash_table_remove(yd->xfer_peer_idstring_map, xd->xfer_peer_idstring);
}
- /* empty file & filesize list */
- for (l = xd->filename_list; l; l = l->next) {
- g_free(l->data);
- l->data=NULL;
- }
- for (l = xd->size_list; l; l = l->next) {
- g_free(l->data);
- l->data=NULL;
- }
- g_slist_free(xd->filename_list);
- g_slist_free(xd->size_list);
+ g_slist_free_full(xd->filename_list, g_free);
+ g_slist_free_full(xd->size_list, g_free);
g_free(xd->host);
g_free(xd->path);
--- a/libpurple/protocols/yahoo/ycht.c Mon Jan 20 10:15:55 2014 -0800
+++ b/libpurple/protocols/yahoo/ycht.c Mon Jan 20 10:23:02 2014 -0800
@@ -415,13 +415,9 @@
static void ycht_packet_free(YchtPkt *pkt)
{
- GList *l;
-
g_return_if_fail(pkt != NULL);
- for (l = pkt->data; l; l = l->next)
- g_free(l->data);
- g_list_free(pkt->data);
+ g_list_free_full(pkt->data, g_free);
g_free(pkt);
}