1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2026-02-25 05:35:24 +01:00
aerc/lib/send
Robin Jarry 0ec957dfba send: fix double close and swallowed write error
The deferred w.w.Close() caused the underlying writer to always be
closed twice: once via defer and again with the explicit return at
the end. For the SMTP sender this results in calling Quit() on an
already-closed connection.

Remove the defer and instead call w.w.Close() explicitly in each
error path so that the connection is closed exactly once.

Also fix a write error that was silently discarded (return nil instead
of return err).

Fixes: cb1c4c9c62 ("send: ensure crlf line endings")
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: septante <septante@memeware.net>
Acked-by: septante <septante@memeware.net>
2026-02-13 08:53:30 +01:00
..
jmap.go messages: generalize cancellation context 2026-02-09 14:46:27 +01:00
parse.go lib: consolidate SASL authentication code 2026-02-09 14:46:27 +01:00
sender.go send: fix double close and swallowed write error 2026-02-13 08:53:30 +01:00
sendmail.go completion: display descriptions next to choices 2024-10-23 10:22:51 +02:00
smtp.go smtp: fix connection leak 2026-02-13 08:53:30 +01:00