You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2015/10/12 22:45:53 UTC

[2/2] mesos git commit: Fixed file descriptor leak from fts_open.

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 <ch...@gmail.com>
Authored: Mon Oct 12 13:44:41 2015 -0700
Committer: Benjamin Mahler <be...@gmail.com>
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) {