Fix movemail fd leak

* lib-src/movemail.c (main) [!MAIL_USE_SYSTEM_LOCK]:
Fix file descriptor leak, found by GCC 13 -Wanalyzer-fd-leak.
This commit is contained in:
Paul Eggert 2023-05-14 18:51:22 -07:00
parent 3e3f34d71e
commit 92d4bda279

View file

@ -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 */