summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-05-14 18:51:22 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2023-05-14 19:28:10 -0700
commit92d4bda27976b381fc1f7905e83bdb9da050261e (patch)
tree50c159ce84462e2794e94ad0a58d671e827b63b5
parent3e3f34d71e9c3c6c943580dc822afed7a3b0a861 (diff)
downloademacs-92d4bda27976b381fc1f7905e83bdb9da050261e.tar.gz
Fix movemail fd leak
* lib-src/movemail.c (main) [!MAIL_USE_SYSTEM_LOCK]: Fix file descriptor leak, found by GCC 13 -Wanalyzer-fd-leak.
-rw-r--r--lib-src/movemail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index a71be8c2099..6a772e9043e 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -470,7 +470,7 @@ main (int argc, char **argv)
that were set on the file. Better to just empty the file. */
if (unlink (inname) < 0 && errno != ENOENT)
#endif /* MAIL_UNLINK_SPOOL */
- creat (inname, 0600);
+ close (creat (inname, 0600));
}
#endif /* not MAIL_USE_SYSTEM_LOCK */