summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeng Wenhao <pengwenhao@uniontech.com>2020-07-24 13:55:07 +0800
committerPeng Wenhao <pengwenhao@uniontech.com>2020-07-28 13:36:31 +0800
commit59e3073b1cb944128b7533dd85be13074ab07b72 (patch)
treec69dc2518c7ad19634d439b2c5ed75b24a6e74c1 /tests
parentb71c8eb3864f36ba7bafce1fcb7c7caee67f4405 (diff)
Close memory leak in QTestLib support for string to numeric testing
QTest::toString allocates memory by calling qstrdup; that memory must be freed by the caller. Change-Id: I9724db0c617884cf08592968b1411f002ef23204 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmarks/testlib/tostring/tst_tostring.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/benchmarks/testlib/tostring/tst_tostring.cpp b/tests/benchmarks/testlib/tostring/tst_tostring.cpp
index 1731929f98..a1c4aba916 100644
--- a/tests/benchmarks/testlib/tostring/tst_tostring.cpp
+++ b/tests/benchmarks/testlib/tostring/tst_tostring.cpp
@@ -95,7 +95,8 @@ void tst_toString::numeric()
QFETCH(T, datum);
QBENCHMARK {
- QTest::toString<T>(datum);
+ auto tst = QTest::toString<T>(datum);
+ delete [] tst;
}
}