]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix leaked OSDMap 3204/head
authorSage Weil <sage@redhat.com>
Thu, 18 Dec 2014 14:24:49 +0000 (06:24 -0800)
committerSage Weil <sage@redhat.com>
Thu, 18 Dec 2014 14:24:49 +0000 (06:24 -0800)
*** 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 <sage@redhat.com>
src/osd/OSD.cc

index 967dde72e9ba3c461178f6b55c55c4762940a56d..5b47f53e2b77897d4c84c94fba7641884227fa3c 100644 (file)
@@ -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);