diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-12-04 22:59:59 +0000 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-12-04 22:59:59 +0000 | 
| commit | de0337481fca3894c406a2724da30af8cc8bae2f (patch) | |
| tree | e53b247ed84274ee733f7070bc735e1699e84799 /protocols/jabber/jabber.c | |
| parent | aaf92a9eb64327892e39fdbd7113d797d1d68cec (diff) | |
Fixing jabber_login/_logout for better (non-crashing) cleanup on early
connect failure.
Diffstat (limited to 'protocols/jabber/jabber.c')
| -rw-r--r-- | protocols/jabber/jabber.c | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 817d1487..e2a3a27a 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -76,6 +76,8 @@ static void jabber_login( account_t *acc )  	jd->username = g_strdup( acc->user );  	jd->server = strchr( jd->username, '@' ); +	jd->fd = jd->r_inpa = jd->w_inpa = -1; +	  	if( jd->server == NULL )  	{  		imcb_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" ); @@ -231,7 +233,8 @@ static void jabber_logout( struct im_connection *ic )  {  	struct jabber_data *jd = ic->proto_data; -	jabber_end_stream( ic ); +	if( jd->fd >= 0 ) +		jabber_end_stream( ic );  	while( ic->groupchats )  		jabber_chat_free( ic->groupchats ); @@ -249,7 +252,8 @@ static void jabber_logout( struct im_connection *ic )  	if( jd->tx_len )  		g_free( jd->txq ); -	g_hash_table_destroy( jd->node_cache ); +	if( jd->node_cache ) +		g_hash_table_destroy( jd->node_cache );  	xt_free( jd->xt ); | 
