diff --git a/table/table.cc b/table/table.cc index f2b80cbbc..d2d198fb8 100644 --- a/table/table.cc +++ b/table/table.cc @@ -421,8 +421,8 @@ Status Table::InternalGet(const ReadOptions& options, const Slice& k, break; } else { bool didIO = false; - Iterator* block_iter = BlockReader(this, options, iiter->value(), - &didIO); + std::unique_ptr block_iter( + BlockReader(this, options, iiter->value(), &didIO)); if (options.read_tier && block_iter->status().IsIncomplete()) { // couldn't get block from block_cache @@ -440,7 +440,6 @@ Status Table::InternalGet(const ReadOptions& options, const Slice& k, } } s = block_iter->status(); - delete block_iter; } } if (s.ok()) {