]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Close fds on pipe() error in tor_spawn_background().
authorGeorge Kadianakis <desnacked@gmail.com>
Mon, 24 Oct 2011 14:34:10 +0000 (16:34 +0200)
committerNick Mathewson <nickm@torproject.org>
Mon, 12 Mar 2012 16:41:29 +0000 (12:41 -0400)
changes/bug4296 [new file with mode: 0644]
src/common/util.c

diff --git a/changes/bug4296 b/changes/bug4296
new file mode 100644 (file)
index 0000000..c265094
--- /dev/null
@@ -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.
index 3950fc169596710fb5a5c3a1250ee55db136adcf..1807ee7adc013e1ef2bfa53d8a1c59f85147f45e 100644 (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;
   }