From: xie xingguo Date: Wed, 4 May 2016 07:03:55 +0000 (+0800) Subject: mon/Monitor: fix memory leak X-Git-Tag: v10.2.2~31^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=64b948c21a4608a7680012e247f23dd2a3393f3f;p=ceph.git mon/Monitor: fix memory leak Fixes: http://tracker.ceph.com/issues/15793 Signed-off-by: xie xingguo (cherry picked from commit ae5184ac07523a050584a3d621954baeb0dca01a) --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 71c372700589..6959efe3ed1d 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();