From fcc9604d431407a598228943748b19d26ef336cd Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Wed, 4 Jan 2017 08:59:06 +0000 Subject: [PATCH] revoke_perm: don't leak fd at the end of the test; close it This code is unused on FreeBSD, but it mutes a valid Coverity warning which would be true on NetBSD MFC after: 3 days Reported by: Coverity CID: 978311 --- contrib/netbsd-tests/lib/libc/sys/t_revoke.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/netbsd-tests/lib/libc/sys/t_revoke.c b/contrib/netbsd-tests/lib/libc/sys/t_revoke.c index 926d27406aa..8e4c2a39935 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_revoke.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_revoke.c @@ -176,6 +176,9 @@ ATF_TC_BODY(revoke_perm, tc) if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS) atf_tc_fail("revoke(2) did not obey permissions"); +#ifdef __FreeBSD__ + (void)close(fd); +#endif ATF_REQUIRE(unlink(path) == 0); }