From 679652ab3635351a25d176c012b6121a10a8bd9d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 18 Dec 2014 06:24:49 -0800 Subject: [PATCH] osd: fix leaked OSDMap *** CID 1258787: Resource leak (RESOURCE_LEAK) /osd/OSD.cc: 6118 in OSD::handle_osd_map(MOSDMap *)() 6112 << dendl; 6113 clog->warn() << "failed to encode map e" << e << " with expecte crc\n"; 6114 MMonGetOSDMap *req = new MMonGetOSDMap; 6115 req->request_full(e, last); 6116 monc->send_mon_message(req); 6117 last = e - 1; >>> CID 1258787: Resource leak (RESOURCE_LEAK) >>> Variable "o" going out of scope leaks the storage it points to. 6118 break; 6119 } 6120 6121 6122 hobject_t fulloid = get_osdmap_pobject_name(e); 6123 t.write(META_COLL, fulloid, 0, fbl.length(), fbl); Signed-off-by: Sage Weil --- src/osd/OSD.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 967dde72e9ba3..5b47f53e2b778 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -6111,6 +6111,7 @@ void OSD::handle_osd_map(MOSDMap *m) << " but failed to encode full with correct crc; requesting" << dendl; clog->warn() << "failed to encode map e" << e << " with expected crc\n"; + delete o; MMonGetOSDMap *req = new MMonGetOSDMap; req->request_full(e, last); monc->send_mon_message(req); -- 2.39.5