From 5d027c8012bc2a3da8259ed5c9dbe26b0a745ce3 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 22 Jun 2020 22:53:55 +0200 Subject: [PATCH] tlsunittest: Fix memory leak --- unittest/tls/tlsunittest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/tls/tlsunittest.cpp b/unittest/tls/tlsunittest.cpp index 5745901f..118c56bc 100644 --- a/unittest/tls/tlsunittest.cpp +++ b/unittest/tls/tlsunittest.cpp @@ -57,7 +57,7 @@ void TLSUnitTest::testCipherList() if(!QCA::isSupported("tls", QStringLiteral("qca-ossl"))) QWARN("TLS not supported for qca-ossl"); else { - QCA::TLS *tls = new QCA::TLS(QCA::TLS::Stream, nullptr, QStringLiteral("qca-ossl")); + QScopedPointer tls(new QCA::TLS(QCA::TLS::Stream, nullptr, QStringLiteral("qca-ossl"))); QStringList cipherList = tls->supportedCipherSuites(QCA::TLS::TLS_v1); QVERIFY( cipherList.contains(QStringLiteral("TLS_DHE_RSA_WITH_AES_256_CBC_SHA")) ); QVERIFY( cipherList.contains(QStringLiteral("TLS_RSA_WITH_AES_256_CBC_SHA")) );