diff options
author | ngie <ngie@FreeBSD.org> | 2017-01-07 09:21:21 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-01-07 09:21:21 +0000 |
commit | 456d55fdd6019c033347f15b1c7498afb196cb13 (patch) | |
tree | 370ae268c999f71496f6da956c9a336a6343c99e /contrib/netbsd-tests/lib/libc | |
parent | 2f258aec30516931d4ae2adc881e9259e2dbc512 (diff) | |
download | FreeBSD-src-456d55fdd6019c033347f15b1c7498afb196cb13.zip FreeBSD-src-456d55fdd6019c033347f15b1c7498afb196cb13.tar.gz |
MFC r311271:
stat_symlink: don't leak fd; close the file descriptor when done
CID: 978314
Diffstat (limited to 'contrib/netbsd-tests/lib/libc')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/sys/t_stat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_stat.c b/contrib/netbsd-tests/lib/libc/sys/t_stat.c index 5e1d17e..300c6e8 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) |