From 318439af2e77731ae2c3df5e198c1d3e8392d556 Mon Sep 17 00:00:00 2001 From: Simon Ebner Date: Fri, 22 Mar 2019 15:27:35 +0100 Subject: [PATCH] Fix Issue 62 Fixes a leaking pipe. See https://github.com/boostorg/process/issues/62 --- include/boost/process/detail/posix/executor.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/boost/process/detail/posix/executor.hpp b/include/boost/process/detail/posix/executor.hpp index 1390a58e..8b86ed1d 100644 --- a/include/boost/process/detail/posix/executor.hpp +++ b/include/boost/process/detail/posix/executor.hpp @@ -282,7 +282,10 @@ class executor set_error(std::error_code(err, std::system_category()), "Error read pipe"); } if (count == 0) + { + ::close(source); return ; + } std::error_code ec(data[0], std::system_category()); std::string msg(data[1], ' ');