diff options
author | 2014-04-14 22:27:30 +0000 | |
---|---|---|
committer | 2014-04-14 22:27:30 +0000 | |
commit | 2f7ca1ea3c2ed5cd02b8503623325ad8580bab4a (patch) | |
tree | 11056feeea7b00133d76a05639e53715968c640b | |
parent | fix potential race where an allocated inode could fail to get added, (diff) | |
download | wireguard-openbsd-2f7ca1ea3c2ed5cd02b8503623325ad8580bab4a.tar.xz wireguard-openbsd-2f7ca1ea3c2ed5cd02b8503623325ad8580bab4a.zip |
Don't leak socketpair file descriptors if fork fails. Spotted by Balazs
Kezes.
-rw-r--r-- | usr.bin/tmux/job.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/job.c b/usr.bin/tmux/job.c index e4794174d1d..05b0eb9ef81 100644 --- a/usr.bin/tmux/job.c +++ b/usr.bin/tmux/job.c @@ -1,4 +1,4 @@ -/* $OpenBSD: job.c,v 1.32 2013/10/10 12:35:31 nicm Exp $ */ +/* $OpenBSD: job.c,v 1.33 2014/04/14 22:27:30 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); |