From: Danny Al-Gaaf Date: Fri, 10 May 2013 16:15:10 +0000 (+0200) Subject: kv_flat_btree_async.cc: fix resource leak X-Git-Tag: v0.63~41^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d1e0fc64e5024b2aa8e088abb3dc196ab97a5c80;p=ceph.git kv_flat_btree_async.cc: fix resource leak 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 --- diff --git a/src/key_value_store/kv_flat_btree_async.cc b/src/key_value_store/kv_flat_btree_async.cc index 7b0ed2bc4c47..fecf32b6b111 100644 --- a/src/key_value_store/kv_flat_btree_async.cc +++ b/src/key_value_store/kv_flat_btree_async.cc @@ -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;