]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/kv_store_bench: Fix double free error 32439/head
authorluo rixin <luorixin@huawei.com>
Sat, 28 Dec 2019 03:17:29 +0000 (11:17 +0800)
committerluo rixin <luorixin@huawei.com>
Thu, 16 Jan 2020 06:25:16 +0000 (14:25 +0800)
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 <chenxuqiang3@hisilicon.com>
Signed-off-by: luo rixin <luorixin@huawei.com>
src/test/kv_store_bench.cc

index d3ca358b1fb9ace17f30d463c71a0a123974f050..bc35346e41d10a5c35ec976d56667d30a41fe222 100644 (file)
@@ -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; });