svn commit: r311246 - head/contrib/netbsd-tests/lib/libc/c063

Ngie Cooper ngie at FreeBSD.org
Wed Jan 4 04:27:14 UTC 2017


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");
 		}
 	}


More information about the svn-src-head mailing list