aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2017-01-04 08:49:07 +0000
committerEnji Cooper <ngie@FreeBSD.org>2017-01-04 08:49:07 +0000
commit621b0f13af96874bc6fb17ea007313d15e6cbf72 (patch)
treeff5e337610aea41eb20775609ed903e15746152d /contrib
parentc0b11b8e0414566fbcf4e3290f1fc208e0b6266a (diff)
downloadsrc-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.c3
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)