changeset 13409:0a3c968b07dc

[gaim-migrate @ 15784] Resolve CID 71 Also, add a check for gc == NULL. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 06 Mar 2006 21:35:26 +0000
parents b2efa1432708
children 184d62658af2
files src/protocols/silc/silc.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/silc/silc.c	Mon Mar 06 21:32:26 2006 +0000
+++ b/src/protocols/silc/silc.c	Mon Mar 06 21:35:26 2006 +0000
@@ -144,13 +144,16 @@
 silcgaim_login_connected(gpointer data, gint source, GaimInputCondition cond)
 {
 	GaimConnection *gc = data;
-	SilcGaim sg = gc->proto_data;
+	SilcGaim sg;
 	SilcClient client;
 	SilcClientConnection conn;
-	GaimAccount *account = sg->account;
+	GaimAccount *account;
 	SilcClientConnectionParams params;
 	const char *dfile;
 
+	g_return_if_fail(gc != NULL);
+	sg = gc->proto_data;
+
 	if (source < 0) {
 		gaim_connection_error(gc, _("Connection failed"));
 		return;
@@ -160,6 +163,7 @@
 		return;
 
 	client = sg->client;
+	account = sg->account;
 
 	if (!g_list_find(gaim_connections_get_all(), gc)) {
 		close(source);