# HG changeset patch # User Ka-Hing Cheung # Date 1195633773 0 # Node ID 2c45b94ab72228b0d03605f6fc57ca084377ea11 # Parent a4b6854737d51c1f6d98d6864ecdabb3185e02c3 Andrew Gaul fixed another memory leak diff -r a4b6854737d5 -r 2c45b94ab722 libpurple/protocols/yahoo/yahoo_packet.c --- a/libpurple/protocols/yahoo/yahoo_packet.c Wed Nov 21 05:22:39 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_packet.c Wed Nov 21 08:29:33 2007 +0000 @@ -219,16 +219,15 @@ void yahoo_packet_write(struct yahoo_packet *pkt, guchar *data) { - GSList *l = pkt->hash; int pos = 0; /* This is only called from one place, and the list is * always backwards */ - l = g_slist_reverse(l); + pkt->hash = g_slist_reverse(pkt->hash); - while (l) { - struct yahoo_pair *pair = l->data; + while (pkt->hash) { + struct yahoo_pair *pair = pkt->hash->data; gchar buf[100]; g_snprintf(buf, sizeof(buf), "%d", pair->key); @@ -242,7 +241,7 @@ data[pos++] = 0xc0; data[pos++] = 0x80; - l = l->next; + pkt->hash = pkt->hash->next; } }