ftok_link: don't leak fd

MFC after:	3 days
Reported by:	Coverity
CID:		978291
This commit is contained in:
Enji Cooper 2017-01-04 02:34:30 +00:00
parent 05aee7d5b0
commit 06cd8428bc

View File

@ -68,6 +68,9 @@ ATF_TC_BODY(ftok_link, tc)
fd = open(path, O_RDONLY | O_CREAT);
ATF_REQUIRE(fd >= 0);
#ifdef __FreeBSD__
(void)close(fd);
#endif
ATF_REQUIRE(link(path, hlnk) == 0);
ATF_REQUIRE(symlink(path, slnk) == 0);