Fixed heap-use-after-free error in compaction_job_test.cc

Summary: Fixed heap-use-after-free error in compaction_job_test.cc

Test Plan: compaction_job_test

Reviewers: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D39411
main
Yueh-Hsuan Chiang 10 years ago
parent 8d8d4e45ba
commit 3083ed2129
  1. 3
      db/compaction_job_test.cc

@ -163,11 +163,12 @@ TEST_F(CompactionJobTest, Simple) {
LogBuffer log_buffer(InfoLogLevel::INFO_LEVEL, db_options_.info_log.get());
mutex_.Lock();
EventLogger event_logger(db_options_.info_log.get());
std::string db_name = "dbname";
CompactionJob compaction_job(0, compaction.get(), db_options_, env_options_,
versions_.get(), &shutting_down_, &log_buffer,
nullptr, nullptr, nullptr, {}, table_cache_,
std::move(yield_callback), &event_logger, false,
"dbname");
db_name);
compaction_job.Prepare();
mutex_.Unlock();

Loading…
Cancel
Save