diff options
author | Yoonsoo Kim <yoonsoo.kim@mongodb.com> | 2021-07-20 01:15:01 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-07-20 14:58:17 +0000 |
commit | 4b8e059870e0bed6c44ba0e75b4ac169c0bf4f33 (patch) | |
tree | 4a456d3a4777bb17eb2b1b352101d0a7d4ca9fae /src | |
parent | 5d763763db2fcd9b2799faa7e1ef246df3c325a9 (diff) | |
download | mongo-4b8e059870e0bed6c44ba0e75b4ac169c0bf4f33.tar.gz |
SERVER-58127 Fix benchRun() memory leak under an exception
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/shell/bench.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/shell/bench.cpp b/src/mongo/shell/bench.cpp index 7d0187e81bf..91d3bae7a3b 100644 --- a/src/mongo/shell/bench.cpp +++ b/src/mongo/shell/bench.cpp @@ -352,9 +352,9 @@ void BenchRunConfig::initializeToDefaults() { } BenchRunConfig* BenchRunConfig::createFromBson(const BSONObj& args) { - BenchRunConfig* config = new BenchRunConfig(); + auto config = std::make_unique<BenchRunConfig>(); config->initializeFromBson(args); - return config; + return config.release(); } BenchRunOp opFromBson(const BSONObj& op) { |