You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/10/24 23:19:06 UTC

[2/8] mesos git commit: Libprocess Reinit: Removed authorizer callback leaks.

Libprocess Reinit: Removed authorizer callback leaks.

The `authorization_callbacks` were never being freed after being set
or unset.  If you run the tests in repetition, this leaks memory.

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


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

Branch: refs/heads/master
Commit: b851894079565aff88e23dec087bd90a0a832c6b
Parents: eaee376
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Mon Oct 24 15:06:32 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Mon Oct 24 16:18:10 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/b8518940/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 35ed637..15e80e6 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -582,12 +582,20 @@ namespace authorization {
 
 void setCallbacks(const AuthorizationCallbacks& callbacks)
 {
+  if (authorization_callbacks != nullptr) {
+    delete authorization_callbacks;
+  }
+
   authorization_callbacks = new AuthorizationCallbacks(callbacks);
 }
 
 
 void unsetCallbacks()
 {
+  if (authorization_callbacks != nullptr) {
+    delete authorization_callbacks;
+  }
+
   authorization_callbacks = nullptr;
 }