From 478b576a7157e9916273613c368ab6613ecceb08 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 28 May 2013 12:43:12 +0200 Subject: [PATCH] kv_flat_btree_async.cc: fix AioCompletion resource leak Call AioCompletion::release() if the completion is no longer needed. CID 727978 (#1-2 of 2): Resource leak (RESOURCE_LEAK) leaked_storage: Variable "obj_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..d8836a01ef4e6 100644 --- a/src/key_value_store/kv_flat_btree_async.cc +++ b/src/key_value_store/kv_flat_btree_async.cc @@ -669,11 +669,13 @@ int KvFlatBtreeAsync::read_object(const string &obj, object_data * odata) { err = obj_aioc->get_return_value(); if (err < 0){ //possibly -ENOENT, meaning someone else deleted it. + obj_aioc->release(); return err; } odata->unwritable = string(unw_bl.c_str(), unw_bl.length()) == "1"; odata->version = obj_aioc->get_version(); odata->size = odata->omap.size(); + obj_aioc->release(); return 0; } -- 2.39.5