Fixed file descriptor leak from fts_open. Review: https://reviews.apache.org/r/39193
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/faae791a Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/faae791a Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/faae791a Branch: refs/heads/master Commit: faae791abb642686828b194ff37563e46d72064e Parents: 8e2afb3 Author: Chi Zhang <[email protected]> Authored: Mon Oct 12 13:44:41 2015 -0700 Committer: Benjamin Mahler <[email protected]> Committed: Mon Oct 12 13:45:34 2015 -0700 ---------------------------------------------------------------------- src/linux/cgroups.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/faae791a/src/linux/cgroups.cpp ---------------------------------------------------------------------- diff --git a/src/linux/cgroups.cpp b/src/linux/cgroups.cpp index 53c568b..f67633e 100644 --- a/src/linux/cgroups.cpp +++ b/src/linux/cgroups.cpp @@ -922,7 +922,10 @@ Try<vector<string>> get(const string& hierarchy, const string& cgroup) } if (errno != 0) { - return ErrnoError("Failed to read a node while traversing file system"); + Error error = + ErrnoError("Failed to read a node while traversing file system"); + fts_close(tree); + return error; } if (fts_close(tree) != 0) {
