From: Hugo Villeneuve Date: Tue, 22 Oct 2013 17:56:37 +0000 (-0400) Subject: Fix application crash when IMAP LOGIN command failed X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=77a19822a0b5c8a830c0d5d97f1923cea5541501;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 61f83b8..2cae287 100644 --- a/src/imap.c +++ b/src/imap.c @@ -312,7 +312,7 @@ int IMAP4_CheckForNewMail(void) status = IMAP4_SendCommand(3, argv); if (status != EXIT_SUCCESS) { new_messages = -1; - goto imap4_logout; + goto imap4_connection_terminate; } /* Selecting the mailbox first. */ @@ -351,6 +351,7 @@ imap4_logout: if (status != EXIT_SUCCESS) new_messages = -1; +imap4_connection_terminate: status = ConnectionTerminate(); if (status != EXIT_SUCCESS) new_messages = -1;