diff options
| -rw-r--r-- | irc_user.c | 1 | ||||
| -rw-r--r-- | lib/ssl_gnutls.c | 4 | ||||
| -rw-r--r-- | lib/xmltree.c | 5 | ||||
| -rw-r--r-- | protocols/msn/msn.c | 6 | ||||
| -rw-r--r-- | protocols/msn/ns.c | 1 | ||||
| -rw-r--r-- | protocols/msn/soap.c | 13 | 
6 files changed, 23 insertions, 7 deletions
@@ -156,6 +156,7 @@ int irc_user_set_nick( irc_user_t *iu, const char *new )  	if( iu->host == NULL ) iu->host = g_strdup( iu->nick );  	if( iu->fullname == NULL ) iu->fullname = g_strdup( iu->nick ); +	g_free( iu->key );  	iu->key = g_strdup( key );  	g_hash_table_insert( irc->nick_user_hash, iu->key, iu );  	irc->users = g_slist_insert_sorted( irc->users, iu, irc_user_cmp ); diff --git a/lib/ssl_gnutls.c b/lib/ssl_gnutls.c index 74ac49b6..ee166bd1 100644 --- a/lib/ssl_gnutls.c +++ b/lib/ssl_gnutls.c @@ -193,7 +193,7 @@ int ssl_read( void *conn, char *buf, int len )  	if( st == GNUTLS_E_AGAIN || st == GNUTLS_E_INTERRUPTED )  		ssl_errno = SSL_AGAIN; -	if( 0 && getenv( "BITLBEE_DEBUG" ) && st > 0 ) write( 1, buf, st ); +	if( 0 && getenv( "BITLBEE_DEBUG" ) && st > 0 ) len = write( 1, buf, st );  	return st;  } @@ -214,7 +214,7 @@ int ssl_write( void *conn, const char *buf, int len )  	if( st == GNUTLS_E_AGAIN || st == GNUTLS_E_INTERRUPTED )  		ssl_errno = SSL_AGAIN; -	if( 0 && getenv( "BITLBEE_DEBUG" ) && st > 0 ) write( 1, buf, st ); +	if( 0 && getenv( "BITLBEE_DEBUG" ) && st > 0 ) len = write( 1, buf, st );  	return st;  } diff --git a/lib/xmltree.c b/lib/xmltree.c index bee9007f..54a7dd13 100644 --- a/lib/xmltree.c +++ b/lib/xmltree.c @@ -614,7 +614,10 @@ void xt_add_child( struct xt_node *parent, struct xt_node *child )  /* Same, but at the beginning. */  void xt_insert_child( struct xt_node *parent, struct xt_node *child )  { -	struct xt_node *node, *last; +	struct xt_node *node, *last = NULL; +	 +	if( child == NULL ) +		return; /* BUG */  	for( node = child; node; node = node->next )  	{ diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index 5b2c53f7..161f7590 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -345,8 +345,12 @@ static void msn_buddy_data_add( bee_user_t *bu )  static void msn_buddy_data_free( bee_user_t *bu )  {  	struct msn_data *md = bu->ic->proto_data; +	struct msn_buddy_data *bd = bu->data; +	 +	g_free( bd->cid ); +	g_free( bd ); +	  	g_tree_remove( md->domaintree, bu->handle ); -	g_free( bu->data );  }  void msn_initmodule() diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index d64a71ac..3622efe0 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -827,6 +827,7 @@ static void msn_ns_send_adl( struct im_connection *ic )  	}  	adls = xt_to_string( adl ); +	xt_free_node( adl );  	msn_ns_write( ic, -1, "ADL %d %zd\r\n%s", ++md->trId, strlen( adls ), adls );  	g_free( adls );  } diff --git a/protocols/msn/soap.c b/protocols/msn/soap.c index 909f6ad9..7024bbaa 100644 --- a/protocols/msn/soap.c +++ b/protocols/msn/soap.c @@ -209,14 +209,15 @@ static char *msn_soap_abservice_build( const char *body_fmt, const char *scenari  static void msn_soap_debug_print( const char *headers, const char *payload )  {  	char *s; +	int st;  	if( !getenv( "BITLBEE_DEBUG" ) )  		return;  	if( ( s = strstr( headers, "\r\n\r\n" ) ) ) -		write( 1, s, s - headers + 4 ); +		st = write( 1, s, s - headers + 4 );  	else -		write( 1, headers, strlen( headers ) ); +		st = write( 1, headers, strlen( headers ) );  #ifdef DEBUG  	{ @@ -282,6 +283,7 @@ static int msn_soap_passport_sso_build_request( struct msn_soap_req_data *soap_r  		soap_req->url = g_strdup( SOAP_PASSPORT_SSO_URL );  	strncpy( pass, ic->acc->pass, MAX_PASSPORT_PWLEN ); +	pass[MAX_PASSPORT_PWLEN] = '\0';  	soap_req->payload = g_markup_printf_escaped( SOAP_PASSPORT_SSO_PAYLOAD,  		ic->acc->user, pass, md->pp_policy ); @@ -439,6 +441,7 @@ static int msn_soap_passport_sso_free_data( struct msn_soap_req_data *soap_req )  	g_free( sd->secret );  	g_free( sd->error );  	g_free( sd->redirect ); +	g_free( sd );  	return MSN_SOAP_OK;  } @@ -526,12 +529,16 @@ static int msn_soap_oim_handle_response( struct msn_soap_req_data *soap_req )  	}  	else if( soap_req->http_req->status_code == 200 )  	{ +		/* Noise..  		imcb_log( soap_req->ic, "Offline message successfully delivered to %s", oim->to ); +		*/  		return MSN_SOAP_OK;  	}  	else  	{ -		imcb_log( soap_req->ic, "Failed to deliver offline message to %s:\n%s", oim->to, oim->msg ); +		char *dec = frombase64( oim->msg ); +		imcb_log( soap_req->ic, "Failed to deliver offline message to %s:\n%s", oim->to, dec ); +		g_free( dec );  		return MSN_SOAP_ABORT;  	}  }  | 
