]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/MemStore: fix use-after-free on iterator 6963/head
authorSage Weil <sage@redhat.com>
Thu, 17 Dec 2015 15:29:31 +0000 (10:29 -0500)
committerSage Weil <sage@redhat.com>
Thu, 17 Dec 2015 16:30:09 +0000 (11:30 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/MemStore.cc

index 9033ad0985bbdcff3496ddada6402dea4ca00431..fd791703997da399781cebdd1e4cead0766bdde5 100644 (file)
@@ -1024,9 +1024,9 @@ int MemStore::_remove(coll_t cid, const ghobject_t& oid)
   auto i = c->object_hash.find(oid);
   if (i == c->object_hash.end())
     return -ENOENT;
+  used_bytes -= i->second->get_size();
   c->object_hash.erase(i);
   c->object_map.erase(oid);
-  used_bytes -= i->second->get_size();
 
   return 0;
 }