Don't leak socketpair file descriptors if fork fails. Spotted by Balazs

Kezes.
This commit is contained in:
nicm 2014-04-14 22:27:30 +00:00
parent b8bda67f30
commit a47d2397df

2
job.c
View File

@ -60,6 +60,8 @@ job_run(const char *cmd, struct session *s,
switch (pid = fork()) {
case -1:
environ_free(&env);
close(out[0]);
close(out[1]);
return (NULL);
case 0: /* child */
clear_signals(1);