--- a/libpurple/protocols/oscar/tlv.c Tue Oct 15 04:05:27 2019 +0000 +++ b/libpurple/protocols/oscar/tlv.c Wed Oct 16 01:06:17 2019 +0300 @@ -233,11 +233,7 @@ */ void aim_tlvlist_free(GSList *list) { - while (list != NULL) - { - freetlv(list->data); - list = g_slist_delete_link(list, list); - } + g_slist_free_full(list, (GDestroyNotify)freetlv); } /** @@ -248,16 +244,7 @@ */ int aim_tlvlist_count(GSList *list) { - GSList *cur; - int count; - - if (list == NULL) - return 0; - - for (cur = list, count = 0; cur; cur = cur->next) - count++; - - return count; + return (int)g_slist_length(list); } /**