From: Danny Al-Gaaf Date: Tue, 28 May 2013 10:27:37 +0000 (+0200) Subject: kv_flat_btree_async.cc: fix AioCompletion resource leak X-Git-Tag: v0.64~45^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F325%2Fhead;p=ceph.git kv_flat_btree_async.cc: fix AioCompletion resource leak Call AioCompletion::release() if the completion is no longer needed. CID 727980 (#1-4 of 4): Resource leak (RESOURCE_LEAK) leaked_storage: Variable "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 77d11b0951ca..8fb7e5cc96c3 100644 --- a/src/key_value_store/kv_flat_btree_async.cc +++ b/src/key_value_store/kv_flat_btree_async.cc @@ -2065,6 +2065,7 @@ bool KvFlatBtreeAsync::is_consistent() { err = aioc->get_return_value(); if (ceph_clock_now(g_ceph_context) - idata.ts > timeout) { if (err < 0) { + aioc->release(); if (err == -ENOENT) { continue; } else { @@ -2083,6 +2084,7 @@ bool KvFlatBtreeAsync::is_consistent() { } } special_names.insert(dit->obj); + aioc->release(); } for(vector::iterator cit = idata.to_create.begin(); cit != idata.to_create.end(); ++cit) {