svn commit: r311248 - head/contrib/netbsd-tests/lib/libc/c063

Ngie Cooper ngie at FreeBSD.org
Wed Jan 4 04:32:01 UTC 2017


Author: ngie
Date: Wed Jan  4 04:32:00 2017
New Revision: 311248
URL: https://svnweb.freebsd.org/changeset/base/311248

Log:
  mknodat_fd: close dfd after use to avoid leaking it
  
  MFC after:	3 days
  Reported by:	Coverity
  CID:		978287

Modified:
  head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c

Modified: head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c	Wed Jan  4 04:29:53 2017	(r311247)
+++ head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c	Wed Jan  4 04:32:00 2017	(r311248)
@@ -80,6 +80,9 @@ ATF_TC_BODY(mknodat_fd, tc)
 	ATF_REQUIRE((fd = mknodat(dfd, BASEFILE, mode, dev)) != -1);
 	ATF_REQUIRE(close(fd) == 0);
 	ATF_REQUIRE(access(FILE, F_OK) == 0);
+#ifdef	__FreeBSD__
+	(void)close(dfd);
+#endif
 }
 
 ATF_TC(mknodat_fdcwd);


More information about the svn-src-all mailing list