Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jan 2017 04:27:13 +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: r311246 - head/contrib/netbsd-tests/lib/libc/c063
Message-ID:  <201701040427.v044RDUi080576@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Wed Jan  4 04:27:13 2017
New Revision: 311246
URL: https://svnweb.freebsd.org/changeset/base/311246

Log:
  fexecve: don't leak fd on fexecve(2) failure; close before calling err
  
  MFC after:	3 days
  Reported by:	Coverity
  CID:		978285

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

Modified: head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c	Wed Jan  4 04:19:05 2017	(r311245)
+++ head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c	Wed Jan  4 04:27:13 2017	(r311246)
@@ -70,6 +70,9 @@ ATF_TC_BODY(fexecve, tc)
 				error = 76;
 			else
 				error = EXIT_FAILURE;
+#ifdef	__FreeBSD__
+			(void)close(fd);
+#endif
 			err(error, "fexecve");
 		}
 	}



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