# HG changeset patch # User Mark Doliner # Date 1176071382 0 # Node ID de619a9523f91da6aceb6114aeb56ccbc762be5b # Parent 85d93833a3492b91f75f3fd322e43e17ad88d0b9 sf patch #1694728, from Andrew Gaul plug 2 memleaks when setting icons. One of them was leaking the size of the icon for Yahoo!, the other was leaking a patch to an icon on the local file system for oscar. Fantastico diff -r 85d93833a349 -r de619a9523f9 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Sun Apr 08 15:05:11 2007 +0000 +++ b/libpurple/protocols/oscar/oscar.c Sun Apr 08 22:29:42 2007 +0000 @@ -4761,7 +4761,8 @@ PurpleBuddy *b; struct aim_ssi_item *curitem; guint32 tmp; - const char *icon_path, *cached_icon_path; + const char *icon_path; + char *cached_icon_path; va_list ap; guint16 fmtver, numitems; guint32 timestamp; @@ -4997,6 +4998,7 @@ icon_path = purple_account_get_buddy_icon(account); cached_icon_path = purple_buddy_icons_get_full_path(icon_path); oscar_set_icon(gc, cached_icon_path); + g_free(cached_icon_path); return 1; } diff -r 85d93833a349 -r de619a9523f9 libpurple/protocols/yahoo/yahoo_picture.c --- a/libpurple/protocols/yahoo/yahoo_picture.c Sun Apr 08 15:05:11 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_picture.c Sun Apr 08 22:29:42 2007 +0000 @@ -544,6 +544,7 @@ int expire = purple_account_get_int(account, YAHOO_PICEXPIRE_SETTING, 0); const char *oldurl = purple_account_get_string(account, YAHOO_PICURL_SETTING, NULL); + g_free(icondata); yd->picture_checksum = g_string_hash(s); if ((yd->picture_checksum == oldcksum) &&