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

CID 727979 (#1-2 of 2): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "a" 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..baef3157cb53199a6ac575d551bcc2215235a8cf 100644 (file)
@@ -690,12 +690,14 @@ int KvFlatBtreeAsync::read_object(const string &obj, rebalance_args * args) {
     if (verbose) cout << "\t\t" << client_name
        << "-read_object: reading failed with "
        << err << std::endl;
+    a->release();
     return err;
   }
   bufferlist::iterator it = outbl.begin();
   args->decode(it);
   args->odata.name = obj;
   args->odata.version = a->get_version();
+  a->release();
   return err;
 }