svn commit: r311228 - head/contrib/netbsd-tests/lib/libc/gen

Ngie Cooper ngie at FreeBSD.org
Wed Jan 4 02:34:32 UTC 2017


Author: ngie
Date: Wed Jan  4 02:34:30 2017
New Revision: 311228
URL: https://svnweb.freebsd.org/changeset/base/311228

Log:
  ftok_link: don't leak fd
  
  MFC after:	3 days
  Reported by:	Coverity
  CID:		978291

Modified:
  head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c	Wed Jan  4 02:31:05 2017	(r311227)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c	Wed Jan  4 02:34:30 2017	(r311228)
@@ -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);
 


More information about the svn-src-all mailing list