changeset 24969:08a2a4029f20

Fix a segfault when deleting an account without an associated prpl. Reported by adi1 in #pidgin. Fixes #8180.
author Paul Aurich <paul@darkrain42.org>
date Tue, 20 Jan 2009 02:33:43 +0000
parents 5e77f8512f5b
children 0e50e4e7aef7 e096b6226517
files ChangeLog libpurple/blist.c
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jan 19 01:05:27 2009 +0000
+++ b/ChangeLog	Tue Jan 20 02:33:43 2009 +0000
@@ -1,6 +1,9 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
 version 2.5.5 (??/??/????):
+	libpurple:
+	* Fix a crash when removing an account with an unknown protocol id.
+
 	Finch:
 	* Allow rebinding keys to change the focused widget (details in the
 	  man-page, look for GntBox::binding)
--- a/libpurple/blist.c	Mon Jan 19 01:05:27 2009 +0000
+++ b/libpurple/blist.c	Tue Jan 20 02:33:43 2009 +0000
@@ -1811,7 +1811,7 @@
 	PurpleGroup *group;
 	struct _purple_hbuddy hb;
 	PurplePlugin *prpl;
-	PurplePluginProtocolInfo *prpl_info;
+	PurplePluginProtocolInfo *prpl_info = NULL;
 
 	g_return_if_fail(buddy != NULL);
 
@@ -1872,7 +1872,8 @@
 	 * can free proto_data
 	 */
 	prpl = purple_find_prpl(purple_account_get_protocol_id(buddy->account));
-	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+	if (prpl)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 	if (prpl_info && prpl_info->buddy_free)
 		prpl_info->buddy_free(buddy);