# HG changeset patch # User Mark Doliner # Date 1249373681 0 # Node ID 44930be7114bcf06fe388108b0769f9e4688fe46 # Parent 79630bfee621d08503cf6bbd0283b6105a0745ee Fix two memory leaks. We were setting norm_bud and temp to NULL without freeing them first. I'm guessing this wasn't severe, but I didn't really look at what this code does. diff -r 79630bfee621 -r 44930be7114b libpurple/protocols/yahoo/libymsg.c --- a/libpurple/protocols/yahoo/libymsg.c Tue Aug 04 04:19:34 2009 +0000 +++ b/libpurple/protocols/yahoo/libymsg.c Tue Aug 04 08:14:41 2009 +0000 @@ -478,7 +478,7 @@ PurpleAccount *account = purple_connection_get_account(gc); YahooData *yd = gc->proto_data; GHashTable *ht; - char *norm_bud = NULL; + char *norm_bud; char *temp = NULL; YahooFriend *f = NULL; /* It's your friends. They're going to want you to share your StarBursts. */ /* But what if you had no friends? */ @@ -487,7 +487,6 @@ int protocol = 0; int stealth = 0; - ht = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_slist_free); while (l) { @@ -546,9 +545,11 @@ purple_privacy_deny_add(account, norm_bud, 1); } + g_free(norm_bud); + protocol = 0; stealth = 0; - norm_bud = NULL; + g_free(temp); temp = NULL; } break; @@ -559,6 +560,7 @@ yd->current_list15_grp = yahoo_string_decode(gc, pair->value, FALSE); break; case 7: /* buddy's s/n */ + g_free(temp); temp = g_strdup(purple_normalize(account, pair->value)); break; case 241: /* another protocol user */ @@ -594,7 +596,6 @@ yahoo_set_status(account, purple_account_get_active_status(account)); g_hash_table_destroy(ht); - g_free(norm_bud); g_free(temp); }