diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2010-07-27 12:46:01 (GMT) |
---|---|---|
committer | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2010-07-27 12:46:01 (GMT) |
commit | 2636e58e748d066096472bc9822f89ba9d4b47a3 (patch) | |
tree | 6a1f8bcc9ea0f6479709bd4e40e54737fa8c52e3 /src/testlib | |
parent | 83dbd809a0af50ac91d1e36a6b0437fc263958f3 (diff) | |
download | Qt-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
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestresult.cpp | 5 |
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; |