Eliminate VersionSet memory leak
Summary: ManifestDumpCommand::DoCommand was allocating a VersionSet and never freeing it. Test Plan: make Reviewers: igor Reviewed By: igor Differential Revision: https://reviews.facebook.net/D22221
This commit is contained in:
parent
10720a5587
commit
e173bf9c19
@ -560,8 +560,8 @@ void ManifestDumpCommand::DoCommand() {
|
|||||||
// if VersionSet::DumpManifest() depends on any option done by
|
// if VersionSet::DumpManifest() depends on any option done by
|
||||||
// SanitizeOptions(), we need to initialize it manually.
|
// SanitizeOptions(), we need to initialize it manually.
|
||||||
options.db_paths.emplace_back("dummy", 0);
|
options.db_paths.emplace_back("dummy", 0);
|
||||||
VersionSet* versions = new VersionSet(dbname, &options, sopt, tc.get());
|
VersionSet versions(dbname, &options, sopt, tc.get());
|
||||||
Status s = versions->DumpManifest(options, file, verbose_, is_key_hex_);
|
Status s = versions.DumpManifest(options, file, verbose_, is_key_hex_);
|
||||||
if (!s.ok()) {
|
if (!s.ok()) {
|
||||||
printf("Error in processing file %s %s\n", manifestfile.c_str(),
|
printf("Error in processing file %s %s\n", manifestfile.c_str(),
|
||||||
s.ToString().c_str());
|
s.ToString().c_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user