From: Sage Weil Date: Mon, 14 Apr 2014 16:26:26 +0000 (-0700) Subject: mon: fix Session ref leak in handle_get_version X-Git-Tag: v0.80-rc1~19^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0d4aed88a1f212bd2ba45d24cdd45767870013d9;p=ceph.git mon: fix Session ref leak in handle_get_version Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 9760a4ca1c84..ae1c857d13f2 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -3537,6 +3537,8 @@ void Monitor::handle_subscribe(MMonSubscribe *m) void Monitor::handle_get_version(MMonGetVersion *m) { dout(10) << "handle_get_version " << *m << dendl; + PaxosService *svc = NULL; + MMonGetVersionReply *reply = NULL; MonSession *s = static_cast(m->get_connection()->get_priv()); if (!s) { @@ -3548,7 +3550,7 @@ void Monitor::handle_get_version(MMonGetVersion *m) if (!is_leader() && !is_peon()) { dout(10) << " waiting for quorum" << dendl; waitfor_quorum.push_back(new C_RetryMessage(this, m)); - return; + goto out; } MMonGetVersionReply *reply = new MMonGetVersionReply(); @@ -3568,8 +3570,10 @@ void Monitor::handle_get_version(MMonGetVersion *m) messenger->send_message(reply, m->get_source_inst()); - s->put(); m->put(); + + out: + s->put(); } bool Monitor::ms_handle_reset(Connection *con)