mon: Fix leak of context
PATCH 1/1 mon: Fix leak of context
From: "Yan, Zheng" <[email protected]>
Use Context::complete() to finish context, it frees the context after executing Context::finish().
Signed-off-by Yan, Zheng <[email protected]>
--- src/mon/Paxos.cc | 2 +- src/mon/Paxos.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
src/mon/Paxos.cc +1 -1
@@ -805,7 +805,7 @@ void Paxos::finish_queued_proposal() << " to finish" << dendl; proposals.pop_front(); - proposal->finish(0); + proposal->complete(0); } }
src/mon/Paxos.h +4 -2
@@ -642,8 +642,10 @@ public: { }void finish (int r) { -if (proposer_context) - proposer_context->finish (r); +if (proposer_context) { + proposer_context->complete (r); + proposer_context =NULL ; + } } };/**
Signature · 1 line
1.8.1.4