diff options
author | Alexander Færøy <ahf@torproject.org> | 2018-12-20 12:47:04 +0100 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2018-12-20 12:47:04 +0100 |
commit | 1d8dcb416c989ad86a1e3ae2aa92f4c2c1339183 (patch) | |
tree | 0d8ee943ed3a7ced0835e9e4989b3a0a77a8d24d /src/lib/process/process_win32.c | |
parent | fe2f4f3ec58ef03e8d3fe802283b848d54b5eb76 (diff) | |
download | tor-1d8dcb416c989ad86a1e3ae2aa92f4c2c1339183.tar.gz tor-1d8dcb416c989ad86a1e3ae2aa92f4c2c1339183.zip |
Remember to close the child process' ends of the pipes.
This prevents us from leaking the HANDLE for stdout, stderr, and stdin.
See: https://bugs.torproject.org/28179
Diffstat (limited to 'src/lib/process/process_win32.c')
-rw-r--r-- | src/lib/process/process_win32.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c index c92b0975a7..a09664b501 100644 --- a/src/lib/process/process_win32.c +++ b/src/lib/process/process_win32.c @@ -248,6 +248,11 @@ process_win32_exec(process_t *process) win32_process->stderr_handle.pipe = stderr_pipe_read; win32_process->stdin_handle.pipe = stdin_pipe_write; + /* Close our ends of the pipes that is now owned by the child process. */ + CloseHandle(stdout_pipe_write); + CloseHandle(stderr_pipe_write); + CloseHandle(stdin_pipe_read); + /* Used by the callback functions from ReadFileEx() and WriteFileEx() such * that we can figure out which process_t that was responsible for the event. * |