From 20a5b40a120f80cb5aa77cbad83513f19a296adc Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 4 Jan 2017 03:41:16 +0000 Subject: [PATCH] umask_open: don't leak fd on success MFC after: 3 days Reported by: Coverity CID: 978315 --- contrib/netbsd-tests/lib/libc/sys/t_umask.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/netbsd-tests/lib/libc/sys/t_umask.c b/contrib/netbsd-tests/lib/libc/sys/t_umask.c index 748cbdcf1ada..7a65574742b8 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) {