diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_client.cpp b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_client.cpp index 2e5a590084..59f9ca7aa8 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_client.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_client.cpp @@ -156,20 +156,6 @@ IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BRemoteMai error << ":" << port; error << ": Host not found."; runner->ShowError(error.String()); - #ifdef USESSL - if (use_ssl) { - if (ssl) - SSL_shutdown(ssl); - if (ctx) - SSL_CTX_free(ctx); - } - #endif - #ifdef BONE - close(net); - #else - closesocket(net); - #endif - net = -1; runner->Stop(true); return; } @@ -187,14 +173,6 @@ IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BRemoteMai saAddr.sin_addr.s_addr = hostIP; int result = connect(net, (struct sockaddr *) &saAddr, sizeof(saAddr)); if (result < 0) { - #ifdef USESSL - if (use_ssl) { - if (ssl) - SSL_shutdown(ssl); - if (ctx) - SSL_CTX_free(ctx); - } - #endif #ifdef BONE close(net); #else @@ -249,6 +227,7 @@ IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BRemoteMai #else closesocket(net); #endif + net = -1; runner->Stop(true); return; }