fexecve: don't leak fd on fexecve(2) failure; close before calling err

MFC after:	3 days
Reported by:	Coverity
CID:		978285
This commit is contained in:
Enji Cooper 2017-01-04 04:27:13 +00:00
parent 3b33767589
commit 5641f109c1

View File

@ -70,6 +70,9 @@ ATF_TC_BODY(fexecve, tc)
error = 76;
else
error = EXIT_FAILURE;
#ifdef __FreeBSD__
(void)close(fd);
#endif
err(error, "fexecve");
}
}