Fix potential memory leak in ArenaWrappedDBIter::Refresh() (#10716)

Summary:
Fix potential memory leak in ArenaWrappedDBIter::Refresh() introduced in https://github.com/facebook/rocksdb/issues/10705. See https://github.com/facebook/rocksdb/pull/10705#discussion_r976765905 for detail.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10716

Test Plan: make check

Reviewed By: ajkr

Differential Revision: D39698561

Pulled By: cbi42

fbshipit-source-id: dc0d0c6e3878eaa84f87623fbe4916b9b08b077a
main
Changyu Bi 2 years ago committed by Facebook GitHub Bot
parent dd40f83e95
commit 013305af13
  1. 1
      db/arena_wrapped_db_iter.cc

@ -93,6 +93,7 @@ Status ArenaWrappedDBIter::Refresh() {
read_options_, latest_seq, false /* immutable_memtable */);
if (!t || t->empty()) {
if (memtable_range_tombstone_iter_) {
delete *memtable_range_tombstone_iter_;
*memtable_range_tombstone_iter_ = nullptr;
}
delete t;

Loading…
Cancel
Save