From 3083ed2129df7ff7ec5b44f939a5c2412f27e8b5 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Tue, 2 Jun 2015 16:20:23 -0700 Subject: [PATCH] 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 --- db/compaction_job_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/compaction_job_test.cc b/db/compaction_job_test.cc index 4460f6859..72747ffe4 100644 --- a/db/compaction_job_test.cc +++ b/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();