From: Peter Pentchev Date: Tue, 22 Jun 2010 23:36:06 +0000 (+0200) Subject: Fix a crash when the SMTP server does not support STARTTLS. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f75033bb045bbd30be11a2ccf2b51334d89601c3;p=people%2Fms%2Fdma.git Fix a crash when the SMTP server does not support STARTTLS. --- diff --git a/net.c b/net.c index 3942d2e..3d4f5d7 100644 --- a/net.c +++ b/net.c @@ -306,12 +306,12 @@ open_connection(struct mx_hostentry *h) static void close_connection(int fd) { - if (((config.features & SECURETRANS) != 0) && - ((config.features & NOSSL) == 0)) - SSL_shutdown(config.ssl); - - if (config.ssl != NULL) + if (config.ssl != NULL) { + if (((config.features & SECURETRANS) != 0) && + ((config.features & NOSSL) == 0)) + SSL_shutdown(config.ssl); SSL_free(config.ssl); + } close(fd); }