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);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to