Repository: mesos Updated Branches: refs/heads/master 5fa5458a1 -> faae791ab
Fixed file descriptor leak from fts_open. Review: https://reviews.apache.org/r/39192 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8e2afb3c Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8e2afb3c Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8e2afb3c Branch: refs/heads/master Commit: 8e2afb3ccef19029253e7b65671b67fe00a72ae6 Parents: 5fa5458 Author: Chi Zhang <[email protected]> Authored: Mon Oct 12 13:44:10 2015 -0700 Committer: Benjamin Mahler <[email protected]> Committed: Mon Oct 12 13:44:10 2015 -0700 ---------------------------------------------------------------------- .../3rdparty/stout/include/stout/posix/os.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/8e2afb3c/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp index 5d2f39d..a042d06 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp @@ -240,13 +240,17 @@ inline Try<Nothing> rmdir(const std::string& directory, bool recursive = true) switch (node->fts_info) { case FTS_DP: if (::rmdir(node->fts_path) < 0 && errno != ENOENT) { - return ErrnoError(); + Error error = ErrnoError(); + fts_close(tree); + return error; } break; case FTS_F: case FTS_SL: if (::unlink(node->fts_path) < 0 && errno != ENOENT) { - return ErrnoError(); + Error error = ErrnoError(); + fts_close(tree); + return error; } break; default: @@ -255,7 +259,9 @@ inline Try<Nothing> rmdir(const std::string& directory, bool recursive = true) } if (errno != 0) { - return ErrnoError(); + Error error = ErrnoError(); + fts_close(tree); + return error; } if (fts_close(tree) < 0) {
