messages: Close port after downloading mail.
[software/mumi.git] / mumi / messages.scm
index cce28140967ef69fc83d5610168ec1a6a61df02c..23a675250c92387400b6767dbaa29c1c484a98b6 100644 (file)
@@ -1,5 +1,5 @@
 ;;; mumi -- Mediocre, uh, mail interface
-;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This program is free software: you can redistribute it and/or
@@ -172,7 +172,8 @@ target file."
                             (with-output-to-file file-name
                               (lambda ()
                                 (put-bytevector (current-output-port)
-                                                (get-bytevector-all port))))))
+                                                (get-bytevector-all port))))
+                            (close-port port)))
                         file-name)))))))
 
 ;; We would like to use get-bug-log here, but it often returns