From ae5184ac07523a050584a3d621954baeb0dca01a Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 4 May 2016 15:03:55 +0800 Subject: [PATCH] mon/Monitor: fix memory leak Fixes: http://tracker.ceph.com/issues/15793 Signed-off-by: xie xingguo --- src/mon/Monitor.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 71c3727005892..6959efe3ed1d1 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -3762,14 +3762,14 @@ void Monitor::handle_ping(MonOpRequestRef op) MPing *reply = new MPing; entity_inst_t inst = m->get_source_inst(); bufferlist payload; - Formatter *f = new JSONFormatter(true); + boost::scoped_ptr f(new JSONFormatter(true)); f->open_object_section("pong"); list health_str; - get_health(health_str, NULL, f); + get_health(health_str, NULL, f.get()); { stringstream ss; - get_mon_status(f, ss); + get_mon_status(f.get(), ss); } f->close_section(); -- 2.39.5