[tor-commits] [tor/master] Actually close the stdout pipe on error in process_unix_exec

nickm at torproject.org nickm at torproject.org
Fri Jan 11 23:55:15 UTC 2019


commit df1a8a657eadcc156032aa558ae0395cde878ee8
Author: Kris Katterjohn <katterjohn at gmail.com>
Date:   Fri Jan 4 13:48:08 2019 -0600

    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 at gmail.com>
---
 src/lib/process/process_unix.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/process/process_unix.c b/src/lib/process/process_unix.c
index 57ca69a76..dd4ccbf60 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]);



More information about the tor-commits mailing list