summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-01-07 09:21:26 +0000
committerngie <ngie@FreeBSD.org>2017-01-07 09:21:26 +0000
commitab93c8b479434952500096c00487aabfb5fa7b30 (patch)
tree8c894b35db623e766fb4cad39cbb8b7d20a30b1c
parent1385b933c8d9fdf4da14be9eb1dd84584b86c19c (diff)
downloadFreeBSD-src-ab93c8b479434952500096c00487aabfb5fa7b30.zip
FreeBSD-src-ab93c8b479434952500096c00487aabfb5fa7b30.tar.gz
MFC r311271:
stat_symlink: don't leak fd; close the file descriptor when done CID: 978314
-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 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)
OpenPOWER on IntegriCloud