]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kv_flat_btree_async.cc: fix resource leak
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 10 May 2013 16:15:10 +0000 (18:15 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 10 May 2013 22:02:56 +0000 (00:02 +0200)
Call AioCompletion::release() if the completion is no longer
needed to free the resources.

CID 727976 Resource leak (CWE-404)
CID 727977 Resource leak (CWE-404)

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

index 7b0ed2bc4c474a1e66c19fa4be54df6c322678e0..fecf32b6b111b2008bcc3f2c4a23bc4808e44064 100644 (file)
@@ -1935,6 +1935,7 @@ int KvFlatBtreeAsync::remove_all() {
     return err;
   }
   oro_aioc->wait_for_safe();
+  oro_aioc->release();
 
   librados::ObjectWriteOperation rm_index;
   librados::AioCompletion * rm_index_aioc = rados.aio_create_completion();
@@ -1944,6 +1945,7 @@ int KvFlatBtreeAsync::remove_all() {
   rm_index.omap_set(new_index);
   io_ctx.aio_operate(index_name, rm_index_aioc, &rm_index);
   err = rm_index_aioc->get_return_value();
+  rm_index_aioc->release();
   if (err < 0) {
     if (verbose) cout << "rm index aioc failed with " << err
        << std::endl;