From e585d400762758bef3fa60e16c3a3cdea7662794 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Wed, 27 Dec 2000 21:16:43 +0000 Subject: [PATCH] use imap_close to terminate a connection in imap_open() --- imap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/imap.c b/imap.c index f48747c..bb5bc55 100644 --- a/imap.c +++ b/imap.c @@ -619,7 +619,10 @@ imap_open (config_t * box, unsigned int minuid, imap_t * imap) { /* initialize SSL */ if (init_ssl (box)) - return 0; + { + ret = -1; + break; + } imap->sock->ssl = SSL_new (SSLContext); SSL_set_fd (imap->sock->ssl, imap->sock->fd); @@ -714,10 +717,7 @@ imap_open (config_t * box, unsigned int minuid, imap_t * imap) if (ret) { - imap_exec (imap, "LOGOUT"); - close (s); - free (imap->buf); - free (imap); + imap_close (imap); imap = 0; }