]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kv_flat_btree_async.cc: fix resource leak 320/head
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 24 May 2013 12:29:14 +0000 (14:29 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 24 May 2013 12:43:17 +0000 (14:43 +0200)
Call AioCompletion::release() if the completion is no longer
needed to free the resources.

CID 727983 : 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 c79555e7de99567a3ae905ddc775db216a18cd35..663fcde44dbf8fdb032e96e468ef99f15df6da00 100644 (file)
@@ -1815,6 +1815,7 @@ int KvFlatBtreeAsync::set_many(const map<string, bufferlist> &in_map) {
   io_ctx.aio_exec(index_name, aioc,  "kvs", "read_many", inbl, &outbl);
   aioc->wait_for_safe();
   err = aioc->get_return_value();
+  aioc->release();
   if (err < 0) {
     cerr << "getting index failed with " << err << std::endl;
     return err;