summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Katterjohn <katterjohn@gmail.com>2019-01-04 13:48:08 -0600
committerNick Mathewson <nickm@torproject.org>2019-01-11 18:55:09 -0500
commitdf1a8a657eadcc156032aa558ae0395cde878ee8 (patch)
tree4665422a4ba787567263099972ae959ac045f380
parentd21fa48cac0f41bd52306e269796559f75855323 (diff)
downloadtor-df1a8a657eadcc156032aa558ae0395cde878ee8.tar.gz
tor-df1a8a657eadcc156032aa558ae0395cde878ee8.zip
Actually close the stdout pipe on error in process_unix_exec
When cleaning up after an error in process_unix_exec, the stdin pipe was being double closed instead of closing both the stdin and stdout pipes. This occurred in two places. Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
-rw-r--r--src/lib/process/process_unix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/process/process_unix.c b/src/lib/process/process_unix.c
index 57ca69a768..dd4ccbf603 100644
--- a/src/lib/process/process_unix.c
+++ b/src/lib/process/process_unix.c
@@ -183,8 +183,8 @@ process_unix_exec(process_t *process)
close(stdin_pipe[1]);
/** Cleanup standard out pipe. */
- close(stdin_pipe[0]);
- close(stdin_pipe[1]);
+ close(stdout_pipe[0]);
+ close(stdout_pipe[1]);
return PROCESS_STATUS_ERROR;
}
@@ -281,8 +281,8 @@ process_unix_exec(process_t *process)
close(stdin_pipe[1]);
/** Cleanup standard out pipe. */
- close(stdin_pipe[0]);
- close(stdin_pipe[1]);
+ close(stdout_pipe[0]);
+ close(stdout_pipe[1]);
/** Cleanup standard error pipe. */
close(stderr_pipe[0]);