summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-13 13:03:18 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-14 18:39:30 +0200
commitcab8e9bfcdd7ce0580904bb001c58f1dad5f43bb (patch)
treedf4d65ce05153a12d494958b19ddcec5e1772ad2
parentd8cb7dfc223d7dc37467f8e37a0eb8c8a0228a75 (diff)
downloadceph-cab8e9bfcdd7ce0580904bb001c58f1dad5f43bb.tar.gz
test/kv_store_bench.cc: fix resource leak
CID 727984 (#5 of 5): Resource leak (RESOURCE_LEAK) leaked_storage: Variable "cb_args" going out of scope leaks the storage it points to. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r--src/test/kv_store_bench.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/kv_store_bench.cc b/src/test/kv_store_bench.cc
index ba5b795d95b..698105c9f39 100644
--- a/src/test/kv_store_bench.cc
+++ b/src/test/kv_store_bench.cc
@@ -373,6 +373,7 @@ int KvStoreBench::test_teuthology_aio(next_gen_t distr,
kv = (((KvStoreBench *)this)->*distr)(true);
if (kv.first == "") {
i--;
+ delete cb_args;
continue;
}
ops_in_flight++;
@@ -384,6 +385,7 @@ int KvStoreBench::test_teuthology_aio(next_gen_t distr,
kv = (((KvStoreBench *)this)->*distr)(false);
if (kv.first == "") {
i--;
+ delete cb_args;
continue;
}
ops_in_flight++;
@@ -395,6 +397,7 @@ int KvStoreBench::test_teuthology_aio(next_gen_t distr,
kv = (((KvStoreBench *)this)->*distr)(false);
if (kv.first == "") {
i--;
+ delete cb_args;
continue;
}
key_set.erase(kv.first);
@@ -406,6 +409,7 @@ int KvStoreBench::test_teuthology_aio(next_gen_t distr,
kv = (((KvStoreBench *)this)->*distr)(false);
if (kv.first == "") {
i--;
+ delete cb_args;
continue;
}
bufferlist val;
@@ -415,6 +419,10 @@ int KvStoreBench::test_teuthology_aio(next_gen_t distr,
cb_args, &cb_args->err);
break;
}
+
+ if (cb_args) {
+ delete cb_args;
+ }
}
while(ops_in_flight > 0) {