Skip to content

Commit

Permalink
Eliminate VersionSet memory leak
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jonah Cohen committed Aug 20, 2014
1 parent 10720a5 commit e173bf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/ldb_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ void ManifestDumpCommand::DoCommand() {
// if VersionSet::DumpManifest() depends on any option done by
// SanitizeOptions(), we need to initialize it manually.
options.db_paths.emplace_back("dummy", 0);
VersionSet* versions = new VersionSet(dbname, &options, sopt, tc.get());
Status s = versions->DumpManifest(options, file, verbose_, is_key_hex_);
VersionSet versions(dbname, &options, sopt, tc.get());
Status s = versions.DumpManifest(options, file, verbose_, is_key_hex_);
if (!s.ok()) {
printf("Error in processing file %s %s\n", manifestfile.c_str(),
s.ToString().c_str());
Expand Down

0 comments on commit e173bf9

Please sign in to comment.