From e4a79f6b38311bb2b2904775b4785c58c348ef3a Mon Sep 17 00:00:00 2001 From: ngie Date: Sat, 7 Jan 2017 09:42:42 +0000 Subject: MFC r311248: mknodat_fd: close dfd after use to avoid leaking it CID: 978287 --- contrib/netbsd-tests/lib/libc/c063/t_mknodat.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'contrib/netbsd-tests') diff --git a/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c b/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c index b04a159..e8f71cd 100644 --- a/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c +++ b/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c @@ -80,6 +80,9 @@ ATF_TC_BODY(mknodat_fd, tc) ATF_REQUIRE((fd = mknodat(dfd, BASEFILE, mode, dev)) != -1); ATF_REQUIRE(close(fd) == 0); ATF_REQUIRE(access(FILE, F_OK) == 0); +#ifdef __FreeBSD__ + (void)close(dfd); +#endif } ATF_TC(mknodat_fdcwd); -- cgit v1.1