diff options
author | George Burgess IV <gbiv@google.com> | 2018-05-15 18:16:01 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-05-15 18:16:01 -0700 |
commit | 059211abcb154e94dd538ce51a198f41c7988ea5 (patch) | |
tree | f93376e26a2311dd4720ea5bcf47eda88db57f60 /tests | |
parent | fd83124c53bed66ba6777c3fcf4639d31ca0591d (diff) | |
parent | 834d6740eb3ff89a44f3b12550e3007aa8d9c780 (diff) | |
download | extras-059211abcb154e94dd538ce51a198f41c7988ea5.tar.gz |
Merge "Fix a memory leak" am: 8126819588
am: 834d6740eb
Change-Id: I57b2cc286ced486930ab523e8bb44e8266d6200c
Diffstat (limited to 'tests')
-rw-r--r-- | tests/memtest/bandwidth.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/memtest/bandwidth.cpp b/tests/memtest/bandwidth.cpp index aa02e66a..caccd638 100644 --- a/tests/memtest/bandwidth.cpp +++ b/tests/memtest/bandwidth.cpp @@ -24,6 +24,7 @@ #include <unistd.h> #include <map> +#include <memory> #include <vector> @@ -227,7 +228,8 @@ bool processThreadArgs(int argc, char** argv, option_t options[], return false; } - BandwidthBenchmark *bench = createBandwidthBenchmarkObject(*values); + std::unique_ptr<BandwidthBenchmark> bench{ + createBandwidthBenchmarkObject(*values)}; if (!bench) { return false; } @@ -250,7 +252,6 @@ bool processThreadArgs(int argc, char** argv, option_t options[], (*values)["size"].int_value = bench->size(); (*values)["num_warm_loops"].int_value = bench->num_warm_loops(); (*values)["num_loops"].int_value = bench->num_loops(); - delete bench; return true; } |