From: Danny Al-Gaaf Date: Fri, 24 May 2013 12:47:49 +0000 (+0200) Subject: kv_flat_btree_async.cc: fix AioCompletion resource leak X-Git-Tag: v0.64~51^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F321%2Fhead;p=ceph.git kv_flat_btree_async.cc: fix AioCompletion resource leak 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 --- diff --git a/src/key_value_store/kv_flat_btree_async.cc b/src/key_value_store/kv_flat_btree_async.cc index c79555e7de99..ca6f68c30a79 100644 --- a/src/key_value_store/kv_flat_btree_async.cc +++ b/src/key_value_store/kv_flat_btree_async.cc @@ -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();