Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jan 2017 03:41:16 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r311239 - head/contrib/netbsd-tests/lib/libc/sys
Message-ID:  <201701040341.v043fGmX060138@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701040341.v043fGmX060138>