Close fds on pipe() error in tor_spawn_background().

This commit is contained in:
George Kadianakis
2011-10-24 16:34:10 +02:00
committed by Nick Mathewson
parent 9f88c1e14f
commit aae570b493
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
o Minor bugfixes:
- On a failed pipe() call, don't leak fds. Fix for bug 4296; bugfix
on 0.2.3.1-alpha.
+4
View File
@@ -3470,6 +3470,10 @@ tor_spawn_background(const char *const filename, const char **argv,
log_warn(LD_GENERAL,
"Failed to set up pipe for stderr communication with child process: %s",
strerror(errno));
close(stdout_pipe[0]);
close(stdout_pipe[1]);
return status;
}