summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2010-07-27 12:46:01 (GMT)
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2010-07-27 12:46:01 (GMT)
commit2636e58e748d066096472bc9822f89ba9d4b47a3 (patch)
tree6a1f8bcc9ea0f6479709bd4e40e54737fa8c52e3
parent83dbd809a0af50ac91d1e36a6b0437fc263958f3 (diff)
downloadQt-2636e58e748d066096472bc9822f89ba9d4b47a3.zip
Qt-2636e58e748d066096472bc9822f89ba9d4b47a3.tar.gz
Qt-2636e58e748d066096472bc9822f89ba9d4b47a3.tar.bz2
Fix a memory leak in the QTestLib.
A comment string wasn't deleted in expectedFailMode. Reviewed-by: Harald Fernengel
-rw-r--r--src/testlib/qtestresult.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp
index 8c52a82..bbe3e7f 100644
--- a/src/testlib/qtestresult.cpp
+++ b/src/testlib/qtestresult.cpp
@@ -191,10 +191,13 @@ bool QTestResult::expectFail(const char *dataIndex, const char *comment,
QTEST_ASSERT(comment);
QTEST_ASSERT(mode > 0);
- if (!isExpectFailData(dataIndex))
+ if (!isExpectFailData(dataIndex)) {
+ delete[] comment;
return true; // we don't care
+ }
if (QTest::expectFailMode) {
+ delete[] comment;
clearExpectFail();
addFailure("Already expecting a fail", file, line);
return false;