From 98f4024e0a34f0629cbb75c9ddb7039ec9b5a1ba Mon Sep 17 00:00:00 2001 From: Michael Gran Date: Wed, 18 Apr 2018 08:58:42 -0700 Subject: [PATCH] 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 3aa3e159d..c73f5c4aa 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); {