svn commit: r311239 - head/contrib/netbsd-tests/lib/libc/sys

Ngie Cooper ngie at FreeBSD.org
Wed Jan 4 03:41:17 UTC 2017


Author: ngie
Date: Wed Jan  4 03:41:16 2017
New Revision: 311239
URL: https://svnweb.freebsd.org/changeset/base/311239

Log:
  umask_open: don't leak fd on success
  
  MFC after:	3 days
  Reported by:	Coverity
  CID:		978315

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

Modified: head/contrib/netbsd-tests/lib/libc/sys/t_umask.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/sys/t_umask.c	Wed Jan  4 03:37:00 2017	(r311238)
+++ head/contrib/netbsd-tests/lib/libc/sys/t_umask.c	Wed Jan  4 03:41:16 2017	(r311239)
@@ -129,6 +129,9 @@ ATF_TC_BODY(umask_open, tc)
 		if (fd < 0)
 			continue;
 
+#ifdef	__FreeBSD__
+		(void)close(fd);
+#endif
 		(void)memset(&st, 0, sizeof(struct stat));
 
 		if (stat(path, &st) != 0) {


More information about the svn-src-all mailing list