[PATCH] mon: Fix leak of context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx>

Use Context::complete() to finish context, it frees the context
after executing Context::finish().

Signed-off-by: Yan, Zheng <zheng.z.yan@xxxxxxxxx>
---
 src/mon/Paxos.cc | 2 +-
 src/mon/Paxos.h  | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc
index 21b9343..46eaf88 100644
--- a/src/mon/Paxos.cc
+++ b/src/mon/Paxos.cc
@@ -805,7 +805,7 @@ void Paxos::finish_queued_proposal()
 	     << " to finish" << dendl;
 
     proposals.pop_front();
-    proposal->finish(0);
+    proposal->complete(0);
   }
 }
 
diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h
index 8fcf66b..ca467ce 100644
--- a/src/mon/Paxos.h
+++ b/src/mon/Paxos.h
@@ -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;
+      }
     }
   };
   /**
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux