Fix mutiple message send under TLS
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 24 Jun 2018 19:30:23 +0000 (20:30 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 24 Jun 2018 19:30:23 +0000 (20:30 +0100)
Broken-by: 74f1a42304
src/src/transports/smtp.c

index 1f0256f3d694d5fc883be76b1dc9e7b591e55ad6..1631817d948a5b86e6e55f79a5ca833f71c84d9d 100644 (file)
@@ -2717,6 +2717,7 @@ for (fd_bits = 3; fd_bits; )
       {
       fd_bits = 0;
       tls_close(ct_ctx, TLS_SHUTDOWN_NOWAIT);
+      ct_ctx = NULL;
       }
     else
       {
@@ -3541,6 +3542,7 @@ if (sx.completed_addr && sx.ok && sx.send_quit)
          the socket on. */
 
          tls_close(sx.cctx.tls_ctx, TLS_SHUTDOWN_WAIT);
+         sx.cctx.tls_ctx = NULL;
          smtp_peer_options = smtp_peer_options_wrap;
          sx.ok = !sx.smtps
            && smtp_write_command(&sx.outblock, SCMD_FLUSH,
@@ -3654,6 +3656,7 @@ END_OFF:
 
 #ifdef SUPPORT_TLS
 tls_close(sx.cctx.tls_ctx, TLS_SHUTDOWN_NOWAIT);
+sx.cctx.tls_ctx = NULL;
 #endif
 
 /* Close the socket, and return the appropriate value, first setting