im.pidgin.pidgin: 91ae77ce12a4ab3798e303eea54d3bef749d5ca5
Sadrul Habib Chowdhury
imadil at gmail.com
Wed Nov 21 15:34:51 EST 2007
* khc at pidgin.im had this to say on [21 Nov 2007, 03:35:37 -0500]:
> -----------------------------------------------------------------
> Revision: 91ae77ce12a4ab3798e303eea54d3bef749d5ca5
> Ancestor: 5727e9151416612d63670c49ed8982d3bb1704b4
> Author: khc at pidgin.im
> Date: 2007-11-21T08:29:33
> Branch: im.pidgin.pidgin
>
> Modified files:
> libpurple/protocols/yahoo/yahoo_packet.c
>
> ChangeLog:
>
> Andrew Gaul fixed another memory leak
>
>
This seems to introduce a memory leak (pkt->hash is lost without being
freed) without fixing one. Are there parts missing from the patch?
Sadrul
> ============================================================
> --- libpurple/protocols/yahoo/yahoo_packet.c 33e9440410856401ba5cd9ae3630ef1710b71333
> +++ libpurple/protocols/yahoo/yahoo_packet.c c244807303180494e5d6ccb3531583f930347979
> @@ -219,16 +219,15 @@ void yahoo_packet_write(struct yahoo_pac
>
> 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 @@ void yahoo_packet_write(struct yahoo_pac
> data[pos++] = 0xc0;
> data[pos++] = 0x80;
>
> - l = l->next;
> + pkt->hash = pkt->hash->next;
> }
> }
>
> _______________________________________________
> Commits mailing list
> Commits at pidgin.im
> http://pidgin.im/cgi-bin/mailman/listinfo/commits
More information about the Devel
mailing list