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
main
Yueh-Hsuan Chiang 9 years ago
parent 6ce42dd075
commit 5ac16300b0
  1. 6
      utilities/options/options_util_test.cc

@ -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

Loading…
Cancel
Save