diff --git a/db/db_bench.cc b/db/db_bench.cc index 9fa86d3ea..802d96467 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -1431,7 +1431,9 @@ class Benchmark { } Slice AllocateKey(std::unique_ptr* key_guard) { - key_guard->reset(new char[key_size_]); + char* data = new char[key_size_]; + const char* const_data = data; + key_guard->reset(const_data); return Slice(key_guard->get(), key_size_); }