Commit df1a8a65 authored by Kris Katterjohn's avatar Kris Katterjohn Committed by Nick Mathewson
Browse files

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: default avatarKris Katterjohn <katterjohn@gmail.com>
parent d21fa48c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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]);