From de30bd07a93fdd62893c26ad810b4cc51bbad9f4 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 20 Sep 2010 10:50:25 +0200 Subject: [PATCH] dma - Fix a crash when the SMTP server does not support STARTTLS Author: Peter Pentchev --- libexec/dma/net.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libexec/dma/net.c b/libexec/dma/net.c index 55d06cf959..3dc9520f08 100644 --- a/libexec/dma/net.c +++ b/libexec/dma/net.c @@ -304,12 +304,13 @@ 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.features & SECURETRANS) != 0) && + ((config.features & NOSSL) == 0)) + SSL_shutdown(config.ssl); - if (config.ssl != NULL) SSL_free(config.ssl); + } close(fd); } -- 2.41.0