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

CID 727981 (#3 of 3): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "top_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..ca6f68c30a797bf36fa31f2e9c6130ac9317d1c2 100644 (file)
@@ -2168,6 +2168,7 @@ string KvFlatBtreeAsync::str() {
   io_ctx.aio_operate(index_name, top_aioc, &oro, NULL);
   top_aioc->wait_for_safe();
   err = top_aioc->get_return_value();
+  top_aioc->release();
   if (err < 0 && err != -5){
     if (verbose) cout << "getting keys failed with error " << err << std::endl;
     return ret.str();