From 2636e58e748d066096472bc9822f89ba9d4b47a3 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Tue, 27 Jul 2010 14:46:01 +0200 Subject: Fix a memory leak in the QTestLib. A comment string wasn't deleted in expectedFailMode. Reviewed-by: Harald Fernengel --- src/testlib/qtestresult.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v0.12