From: Hugo Villeneuve Date: Tue, 22 Oct 2013 17:56:37 +0000 (-0400) Subject: Fix application crash when IMAP LOGIN command failed X-Git-Tag: v1.0.1~2 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=4eb99f732355d1414c272b693e3a64f78df21211;p=dockapps%2Fwmnotify.git Fix application crash when IMAP LOGIN command failed Original error was: wmnotify: Connection reset by peer Error in file "network.c" at line #249 --- diff --git a/src/imap.c b/src/imap.c index da11e47..4f3f288 100644 --- a/src/imap.c +++ b/src/imap.c @@ -285,7 +285,7 @@ IMAP4_CheckForNewMail( void ) status = IMAP4_SendCommand( 1, argv ); if( status != EXIT_SUCCESS ) { new_messages = -1; - goto imap4_logout; + goto imap4_connection_terminate; } if( unseen_string_found == true ) { @@ -299,6 +299,7 @@ IMAP4_CheckForNewMail( void ) new_messages = -1; } +imap4_connection_terminate: status = ConnectionTerminate(); if( status != EXIT_SUCCESS ) { new_messages = -1;