]> git.ipfire.org Git - people/ms/dma.git/commitdiff
Fix a crash when the SMTP server does not support STARTTLS.
authorPeter Pentchev <roam@ringlet.net>
Tue, 22 Jun 2010 23:36:06 +0000 (01:36 +0200)
committerSimon Schubert <2@0x2c.org>
Mon, 28 Jun 2010 22:50:56 +0000 (00:50 +0200)
net.c

diff --git a/net.c b/net.c
index 3942d2e5fd1319500e93d1ec96b3416a6f0cd34b..3d4f5d7fecaa3a9404e1527c1cfaf49e201d938c 100644 (file)
--- 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);
 }