mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bmah...@apache.org
Subject mesos git commit: Fixed a memory leak in process::subprocess.
Date Thu, 24 Mar 2016 03:59:28 GMT
Repository: mesos
Updated Branches:
  refs/heads/master 7370eda61 -> 4f073a066


Fixed a memory leak in process::subprocess.

Review: https://reviews.apache.org/r/45267


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4f073a06
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4f073a06
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4f073a06

Branch: refs/heads/master
Commit: 4f073a066cd68207dc440eba82ce4d76869ae0ea
Parents: 7370eda
Author: Benjamin Mahler <bmahler@apache.org>
Authored: Wed Mar 23 20:30:32 2016 -0700
Committer: Benjamin Mahler <bmahler@apache.org>
Committed: Wed Mar 23 20:59:14 2016 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/subprocess.cpp | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4f073a06/3rdparty/libprocess/src/subprocess.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/subprocess.cpp b/3rdparty/libprocess/src/subprocess.cpp
index 16c327d..bca9521 100644
--- a/3rdparty/libprocess/src/subprocess.cpp
+++ b/3rdparty/libprocess/src/subprocess.cpp
@@ -452,6 +452,12 @@ Try<Subprocess> subprocess(
   // us and we needed to allocate the space.
   if (environment.isSome()) {
     CHECK_NE(os::raw::environment(), envp);
+
+    // We ignore the last 'envp' entry since it is NULL.
+    for (size_t index = 0; index < environment->size(); index++) {
+      delete[] envp[index];
+    }
+
     delete[] envp;
   }
 


Mime
View raw message