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 @@
icq_shutdown(OscarData *od, aim_module_t *mod)
- 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); --- 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 @@
- for (l = yd->cookies; l; l = l->next) {
- g_slist_free(yd->cookies);
+ g_slist_free_full(yd->cookies, g_free); --- 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 @@
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) {
- for (l = xd->size_list; l; l = l->next) {
- 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); --- 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)
g_return_if_fail(pkt != NULL);
- for (l = pkt->data; l; l = l->next)
- g_list_free(pkt->data);
+ g_list_free_full(pkt->data, g_free);