emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 92d4bda2797 04/16: Fix movemail fd leak


From: Paul Eggert
Subject: master 92d4bda2797 04/16: Fix movemail fd leak
Date: Sun, 14 May 2023 22:28:24 -0400 (EDT)

branch: master
commit 92d4bda27976b381fc1f7905e83bdb9da050261e
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    Fix movemail fd leak
    
    * lib-src/movemail.c (main) [!MAIL_USE_SYSTEM_LOCK]:
    Fix file descriptor leak, found by GCC 13 -Wanalyzer-fd-leak.
---
 lib-src/movemail.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]