changeset 3390:a5d356cba156

[gaim-migrate @ 3409] It's best to initialize p and THEN check the contents of it. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 10 Aug 2002 02:42:55 +0000
parents 7cd904828d3d
children 412d1035d666
files src/prpl.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/prpl.c	Thu Aug 08 19:14:20 2002 +0000
+++ b/src/prpl.c	Sat Aug 10 02:42:55 2002 +0000
@@ -75,6 +75,11 @@
 		return;
 	}
 	
+	p = g_new0(struct prpl, 1);
+	pi(p);
+	if ((old = find_prpl(p->protocol)) != NULL)
+		unload_protocol(old);
+
 	if (p->protocol == PROTO_ICQ) 
 		do_error_dialog(_("Gaim has loaded the ICQ plugin.  This plugin has been deprecated. "
 				  "As such, it was probably not compiled from the same version of the "
@@ -82,10 +87,7 @@
 				  "It is reccomended that you use the AIM/ICQ protocol to connect to ICQ"),
 				_("Protocol Warning"));
 
-	p = g_new0(struct prpl, 1);
-	pi(p);
-	if ((old = find_prpl(p->protocol)) != NULL)
-		unload_protocol(old);
+
 	protocols = g_slist_insert_sorted(protocols, p, (GCompareFunc)proto_compare);
 	regenerate_user_list();
 }