mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-23 05:41:21 +01:00
Don't leak socketpair file descriptors if fork fails. Spotted by Balazs
Kezes.
This commit is contained in:
parent
b8bda67f30
commit
a47d2397df
2
job.c
2
job.c
@ -60,6 +60,8 @@ job_run(const char *cmd, struct session *s,
|
|||||||
switch (pid = fork()) {
|
switch (pid = fork()) {
|
||||||
case -1:
|
case -1:
|
||||||
environ_free(&env);
|
environ_free(&env);
|
||||||
|
close(out[0]);
|
||||||
|
close(out[1]);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
case 0: /* child */
|
case 0: /* child */
|
||||||
clear_signals(1);
|
clear_signals(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user