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>
This commit is contained in:
Peng Wenhao 2020-07-24 13:55:07 +08:00
parent b71c8eb386
commit 59e3073b1c

View File

@ -95,7 +95,8 @@ void tst_toString::numeric()
QFETCH(T, datum);
QBENCHMARK {
QTest::toString<T>(datum);
auto tst = QTest::toString<T>(datum);
delete [] tst;
}
}