Fixed valgrind error in options_util_test

Summary:
Fixed valgrind error in options_util_test by deleting the
compaction_filter allocated from RandomInitCFOptions().

Test Plan: valgrind --error-exitcode=2 --leak-check=full ./options_util_test

Reviewers: anthony, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D50661
This commit is contained in:
Yueh-Hsuan Chiang 2015-11-12 14:12:27 -08:00
parent 6ce42dd075
commit 5ac16300b0

View File

@ -80,6 +80,12 @@ TEST_F(OptionsUtilTest, SaveAndLoad) {
ASSERT_NOK(RocksDBOptionsParser::VerifyCFOptions(
cf_opts[i], loaded_cf_descs[i].options));
}
for (size_t i = 0; i < kCFCount; ++i) {
if (cf_opts[i].compaction_filter) {
delete cf_opts[i].compaction_filter;
}
}
}
} // namespace rocksdb