From 533e94c09b371da1caf9da9cb58e46c467d391f3 Mon Sep 17 00:00:00 2001 From: ngie Date: Sat, 7 Jan 2017 08:18:25 +0000 Subject: MFC r311239: umask_open: don't leak fd on success CID: 978315 --- contrib/netbsd-tests/lib/libc/sys/t_umask.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'contrib/netbsd-tests/lib/libc/sys/t_umask.c') diff --git a/contrib/netbsd-tests/lib/libc/sys/t_umask.c b/contrib/netbsd-tests/lib/libc/sys/t_umask.c index 748cbdc..7a65574 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_umask.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_umask.c @@ -129,6 +129,9 @@ ATF_TC_BODY(umask_open, tc) if (fd < 0) continue; +#ifdef __FreeBSD__ + (void)close(fd); +#endif (void)memset(&st, 0, sizeof(struct stat)); if (stat(path, &st) != 0) { -- cgit v1.1