pidgin: 0a697f65: Fix a leak on status updates from federa...

sadrul at pidgin.im sadrul at pidgin.im
Tue Oct 27 20:35:33 EDT 2009


-----------------------------------------------------------------
Revision: 0a697f6573ccc7367245fee28d6d6f2a8f702f0c
Ancestor: 5a6e3558c6661c5485cae1b1c8d3add3fae9da6b
Author: sadrul at pidgin.im
Date: 2009-10-28T00:33:52
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/0a697f6573ccc7367245fee28d6d6f2a8f702f0c

Modified files:
        libpurple/protocols/yahoo/libymsg.c

ChangeLog: 

Fix a leak on status updates from federated buddies on yahoo.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c	9cd578b934df8b2c6e07ef7629f08cba30a5ebae
+++ libpurple/protocols/yahoo/libymsg.c	6e4169045e1cd4c5a7944b48451478003df4ad73
@@ -154,6 +154,7 @@ static void yahoo_process_status(PurpleC
 	gboolean unicode = FALSE;
 	char *message = NULL;
 	YahooFederation fed = YAHOO_FEDERATION_NONE;
+	char *fedname = NULL;
 
 	if (pkt->service == YAHOO_SERVICE_LOGOFF && pkt->status == -1) {
 		if (!purple_account_get_remember_password(account))
@@ -194,18 +195,20 @@ static void yahoo_process_status(PurpleC
 						break;
 					if (p->key == 241) {
 						fed = strtol(p->value, NULL, 10);
+						g_free(fedname);
 						switch (fed) {
 							case YAHOO_FEDERATION_MSN:
-								name = g_strconcat("msn/", name, NULL);
+								name = fedname = g_strconcat("msn/", name, NULL);
 								break;
 							case YAHOO_FEDERATION_OCS:
-								name = g_strconcat("ocs/", name, NULL);
+								name = fedname = g_strconcat("ocs/", name, NULL);
 								break;
 							case YAHOO_FEDERATION_IBM:
-								name = g_strconcat("ibm/", name, NULL);
+								name = fedname = g_strconcat("ibm/", name, NULL);
 								break;
 							case YAHOO_FEDERATION_NONE:
 							default:
+								fedname = NULL;
 								break;
 						}
 						break;
@@ -390,6 +393,7 @@ static void yahoo_process_status(PurpleC
 			yahoo_update_status(gc, name, f);
 	}
 
+	g_free(fedname);
 }
 
 static void yahoo_do_group_check(PurpleAccount *account, GHashTable *ht, const char *name, const char *group)


More information about the Commits mailing list