From: Sage Weil Date: Wed, 12 Apr 2017 13:58:18 +0000 (-0400) Subject: mgr/MgrSession: allow ref tracing, and fix ref leak X-Git-Tag: v12.0.3~296^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e12396cd7cc1dcf40237001a491945623cd29e7a;p=ceph.git mgr/MgrSession: allow ref tracing, and fix ref leak The first RefCountedObj ctor arg is a cct, not a ref count. Fixes: http://tracker.ceph.com/issues/19591 Signed-off-by: Sage Weil --- diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index 24b1d2585dca..f54d903dbd21 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -133,7 +133,7 @@ bool DaemonServer::ms_verify_authorizer(Connection *con, return true; } - MgrSessionRef s(new MgrSession); + MgrSessionRef s(new MgrSession(cct)); s->inst.addr = con->get_peer_addr(); AuthCapsInfo caps_info; diff --git a/src/mgr/MgrSession.h b/src/mgr/MgrSession.h index 328871d2ef96..790d76b8aac4 100644 --- a/src/mgr/MgrSession.h +++ b/src/mgr/MgrSession.h @@ -21,7 +21,7 @@ struct MgrSession : public RefCountedObject { // mon caps are suitably generic for mgr MonCap caps; - MgrSession() : RefCountedObject(0) {} + MgrSession(CephContext *cct) : RefCountedObject(cct, 0) {} ~MgrSession() override {} };