From 9d78b5cd201140d8cbb96ab846159724e28407c2 Mon Sep 17 00:00:00 2001 From: luo rixin Date: Sat, 28 Dec 2019 11:17:29 +0800 Subject: [PATCH] test/kv_store_bench: Fix double free error kvs->aio_xxx is asynchronous function, cb_args will be used and deleted in aio_callbcak_timed, delete cb_agrs in test_teuthology_aio will cause double free error. Signed-off-by: Xuqiang Chen Signed-off-by: luo rixin --- src/test/kv_store_bench.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/kv_store_bench.cc b/src/test/kv_store_bench.cc index d3ca358b1fb..bc35346e41d 100644 --- a/src/test/kv_store_bench.cc +++ b/src/test/kv_store_bench.cc @@ -412,15 +412,16 @@ int KvStoreBench::test_teuthology_aio(next_gen_t distr, delete cb_args; continue; } - bufferlist val; ops_in_flight++; cb_args->sw.start_time(); kvs->aio_get(kv.first, &cb_args->val, aio_callback_timed, cb_args, &cb_args->err); break; + default: + // shouldn't happen here + assert(false); } - delete cb_args; } op_avail.wait(l, [this] { return ops_in_flight <= 0; }); -- 2.39.5