guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 06/06: test-unwind leaks a file descriptor


From: Mike Gran
Subject: [Guile-commits] 06/06: test-unwind leaks a file descriptor
Date: Wed, 18 Apr 2018 12:00:30 -0400 (EDT)

mike121 pushed a commit to branch wip-mingw-guile-2.2
in repository guile.

commit 98f4024e0a34f0629cbb75c9ddb7039ec9b5a1ba
Author: Michael Gran <address@hidden>
Date:   Wed Apr 18 08:58:42 2018 -0700

    test-unwind leaks a file descriptor
    
    * test-suite/standalone/test-unwind.c (check_ports): explicitly close temp 
file
---
 test-suite/standalone/test-unwind.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test-suite/standalone/test-unwind.c 
b/test-suite/standalone/test-unwind.c
index 3aa3e15..c73f5c4 100644
--- a/test-suite/standalone/test-unwind.c
+++ b/test-suite/standalone/test-unwind.c
@@ -221,8 +221,10 @@ check_ports ()
 
   /* Sanity check: Make sure that `filename' is actually writeable.
      We used to use mktemp(3), but that is now considered a security risk.  */
-  if (0 > mkstemp (filename))
+  int fd = mkstemp (filename);
+  if (fd < 0)
     exit (EXIT_FAILURE);
+  close (fd);
 
   scm_dynwind_begin (0);
   {



reply via email to

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