From: George Kadianakis Date: Mon, 24 Oct 2011 14:34:10 +0000 (+0200) Subject: Close fds on pipe() error in tor_spawn_background(). X-Git-Tag: tor-0.2.3.13-alpha~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aae570b4932da15d723b6e7b99038a950fc8a7ad;p=thirdparty%2Ftor.git Close fds on pipe() error in tor_spawn_background(). --- diff --git a/changes/bug4296 b/changes/bug4296 new file mode 100644 index 0000000000..c265094ecb --- /dev/null +++ b/changes/bug4296 @@ -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. diff --git a/src/common/util.c b/src/common/util.c index 3950fc1695..1807ee7adc 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -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; }