From 6939b124929057ce315502e60ef45f13625a8496 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 28 May 2013 12:27:37 +0200 Subject: [PATCH] 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 --- src/key_value_store/kv_flat_btree_async.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/key_value_store/kv_flat_btree_async.cc b/src/key_value_store/kv_flat_btree_async.cc index 77d11b0951ca5..8fb7e5cc96c34 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) { -- 2.39.5