gobjectification: aa2d52a5: Do not crash if an account cannot be cre...

sadrul at pidgin.im sadrul at pidgin.im
Thu Sep 25 16:00:29 EDT 2008


-----------------------------------------------------------------
Revision: aa2d52a5e7c696ea100f4ade80a4a68c51010d60
Ancestor: d174cfdc888b708aab448f33661a732aee66272b
Author: sadrul at pidgin.im
Date: 2008-09-25T20:12:54
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/aa2d52a5e7c696ea100f4ade80a4a68c51010d60

Modified files:
        libpurple/accountmanager.c

ChangeLog: 

Do not crash if an account cannot be created because the prpl can't be loaded.

-------------- next part --------------
============================================================
--- libpurple/accountmanager.c	cd7e3d75d01c32b94e8708ad0d996ce34d3627e0
+++ libpurple/accountmanager.c	e4d7eb707ede42f1f1edd85185e0b12bb3d971e8
@@ -127,7 +127,7 @@ void purple_account_manager_add_account(
 
 void purple_account_manager_add_account(PurpleAccountManager *manager, PurpleAccount *account)
 {
-	if (g_list_find(manager->priv->accounts, account))
+	if (!account || g_list_find(manager->priv->accounts, account))
 		return;
 
 	manager->priv->accounts = g_list_append(manager->priv->accounts, account);
@@ -506,6 +506,8 @@ parse_account(xmlnode *node)
 	ret = purple_account_new(name, _purple_oscar_convert(name, protocol_id)); /* XXX: */
 	g_free(name);
 	g_free(protocol_id);
+	if (!ret)
+		return ret;
 
 	/* Read the password */
 	child = xmlnode_get_child(node, "password");


More information about the Commits mailing list