From 621b0f13af96874bc6fb17ea007313d15e6cbf72 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Wed, 4 Jan 2017 08:49:07 +0000 Subject: stat_symlink: don't leak fd; close the file descriptor when done MFC after: 3 days Reported by: Coverity CID: 978314 --- contrib/netbsd-tests/lib/libc/sys/t_stat.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'contrib') diff --git a/contrib/netbsd-tests/lib/libc/sys/t_stat.c b/contrib/netbsd-tests/lib/libc/sys/t_stat.c index 5e1d17e28e78..300c6e89593c 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_stat.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_stat.c @@ -398,6 +398,9 @@ ATF_TC_BODY(stat_symlink, tc) ATF_REQUIRE(unlink(path) == 0); ATF_REQUIRE(unlink(pathlink) == 0); +#ifdef __FreeBSD__ + (void)close(fd); +#endif } ATF_TC_CLEANUP(stat_symlink, tc) -- cgit v1.2.3