Author: ngie
Date: Wed Jan  4 08:49:07 2017
New Revision: 311271
URL: https://svnweb.freebsd.org/changeset/base/311271

Log:
  stat_symlink: don't leak fd; close the file descriptor when done
  
  MFC after:    3 days
  Reported by:  Coverity
  CID:          978314

Modified:
  head/contrib/netbsd-tests/lib/libc/sys/t_stat.c

Modified: head/contrib/netbsd-tests/lib/libc/sys/t_stat.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/sys/t_stat.c     Wed Jan  4 08:43:27 
2017        (r311270)
+++ head/contrib/netbsd-tests/lib/libc/sys/t_stat.c     Wed Jan  4 08:49:07 
2017        (r311271)
@@ -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)
_______________________________________________
[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