]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kv_flat_btree_async.cc: fix AioCompletion resource leak 325/head
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 28 May 2013 10:27:37 +0000 (12:27 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 28 May 2013 10:27:37 +0000 (12:27 +0200)
Call AioCompletion::release() if the completion is no longer
needed.

CID 727980 (#1-4 of 4): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "aioc" going out of scope leaks
  the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/key_value_store/kv_flat_btree_async.cc

index 77d11b0951ca546960d55077b40861175bca389f..8fb7e5cc96c34a5541557c12356838eff0881584 100644 (file)
@@ -2065,6 +2065,7 @@ bool KvFlatBtreeAsync::is_consistent() {
          err = aioc->get_return_value();
          if (ceph_clock_now(g_ceph_context) - idata.ts > timeout) {
            if (err < 0) {
+             aioc->release();
              if (err == -ENOENT) {
                continue;
              } else {
@@ -2083,6 +2084,7 @@ bool KvFlatBtreeAsync::is_consistent() {
            }
          }
          special_names.insert(dit->obj);
+         aioc->release();
        }
        for(vector<create_data >::iterator cit = idata.to_create.begin();
            cit != idata.to_create.end(); ++cit) {