diff options
author | ngie <ngie@FreeBSD.org> | 2017-01-07 09:42:42 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-01-07 09:42:42 +0000 |
commit | e4a79f6b38311bb2b2904775b4785c58c348ef3a (patch) | |
tree | e7c512dfbe5e4cb6add0b3a9989478d1590fa915 /contrib/netbsd-tests | |
parent | 72ce9598aa9683aa98a0b7866bbb9a0f886520dd (diff) | |
download | FreeBSD-src-e4a79f6b38311bb2b2904775b4785c58c348ef3a.zip FreeBSD-src-e4a79f6b38311bb2b2904775b4785c58c348ef3a.tar.gz |
MFC r311248:
mknodat_fd: close dfd after use to avoid leaking it
CID: 978287
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/c063/t_mknodat.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |