Trivial issues in tor_spawn_background()/tor_check_port_forwarding()

Some things I noticed while coding #3472 (moved) stuff:

  • In tor_spawn_background():
  retval = pipe(stderr_pipe);
  if (-1 == retval) {

if pipe() fails, the file descriptors of pipe(stdout_pipe) above are never closed.

  • In the tor_check_port_forwarding() code or in the Windows version of tor_read_all_handle() the stdout/stderr handles are not CloseHandle()d on stream error.

I'll prepare a patch.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information