aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/msn/ns.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-06-09 03:52:28 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-06-09 03:52:28 +0200
commitc4a1036214c5f5c1ce14e937e8cdabc9fdf2c068 (patch)
treec9efb246958cf81ed2d977f8d00499a136a1b23a /protocols/msn/ns.c
parente46e077ccbe5e3e13637618934a0f7979db6bc69 (diff)
parent783e9b76de9a8ec16e8229d7c476b16ba8011554 (diff)
Merge integration branch.
Diffstat (limited to 'protocols/msn/ns.c')
-rw-r--r--protocols/msn/ns.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c
index ff7da6ed..ffaa90a7 100644
--- a/protocols/msn/ns.c
+++ b/protocols/msn/ns.c
@@ -177,7 +177,15 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )
}
debug( "Connecting to a new switchboard with key %s", cmd[5] );
- sb = msn_sb_create( ic, server, port, cmd[5], MSN_SB_NEW );
+
+ if( ( sb = msn_sb_create( ic, server, port, cmd[5], MSN_SB_NEW ) ) == NULL )
+ {
+ /* Although this isn't strictly fatal for the NS connection, it's
+ definitely something serious (we ran out of file descriptors?). */
+ imcb_error( ic, "Could not create new switchboard" );
+ imc_logout( ic, TRUE );
+ return( 0 );
+ }
if( md->msgq )
{
@@ -467,8 +475,18 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )
debug( "Got a call from %s (session %d). Key = %s", cmd[5], session, cmd[4] );
- sb = msn_sb_create( ic, server, port, cmd[4], session );
- sb->who = g_strdup( cmd[5] );
+ if( ( sb = msn_sb_create( ic, server, port, cmd[4], session ) ) == NULL )
+ {
+ /* Although this isn't strictly fatal for the NS connection, it's
+ definitely something serious (we ran out of file descriptors?). */
+ imcb_error( ic, "Could not create new switchboard" );
+ imc_logout( ic, TRUE );
+ return( 0 );
+ }
+ else
+ {
+ sb->who = g_strdup( cmd[5] );
+ }
}
else if( strcmp( cmd[0], "ADD" ) == 0 )
{