diff options
author | Enji Cooper <ngie@FreeBSD.org> | 2017-01-04 08:49:07 +0000 |
---|---|---|
committer | Enji Cooper <ngie@FreeBSD.org> | 2017-01-04 08:49:07 +0000 |
commit | 621b0f13af96874bc6fb17ea007313d15e6cbf72 (patch) | |
tree | ff5e337610aea41eb20775609ed903e15746152d /contrib | |
parent | c0b11b8e0414566fbcf4e3290f1fc208e0b6266a (diff) | |
download | src-621b0f13af96874bc6fb17ea007313d15e6cbf72.tar.gz src-621b0f13af96874bc6fb17ea007313d15e6cbf72.zip |
stat_symlink: don't leak fd; close the file descriptor when done
MFC after: 3 days
Reported by: Coverity
CID: 978314
Notes
Notes:
svn path=/head/; revision=311271
Diffstat (limited to 'contrib')
-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 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) |