[pim/libkleo/gpg4win/gpd-5.2] /: Don't leak jobs in formattingtest

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 353508cba4006cb6a07b3ed698bf94bd939d6bc4 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 30/07/2026 at 09:38.
Pushed by kloecker into branch 'gpg4win/gpd-5.2'.

Don't leak jobs in formattingtest

(cherry picked from commit 52920fa4c15e91af31c19164965ad706a0c27f9f)

M  +2    -2    autotests/formattingtest.cpp
M  +1    -0    sanitizers.supp

https://invent.kde.org/pim/libkleo/-/commit/353508cba4006cb6a07b3ed698bf94bd939d6bc4

diff --git a/autotests/formattingtest.cpp b/autotests/formattingtest.cpp
index 8ed4422c..e5ec6f33 100644
--- a/autotests/formattingtest.cpp
+++ b/autotests/formattingtest.cpp
@@ -410,11 +410,11 @@ private Q_SLOTS:
 
         const auto signedData = "signed data"_ba;
         QByteArray signature;
-        auto signJob{QGpgME::openpgp()->signJob(true, true)};
+        const std::unique_ptr<QGpgME::SignJob> signJob{QGpgME::openpgp()->signJob(true, true)};
         auto signResult = signJob->exec({key}, signedData, GpgME::Detached, signature);
         QVERIFY(!signResult.error());
 
-        auto verifyJob{QGpgME::openpgp()->verifyDetachedJob(true)};
+        const std::unique_ptr<QGpgME::VerifyDetachedJob> verifyJob{QGpgME::openpgp()->verifyDetachedJob(true)};
         const VerificationResult verificationResult = verifyJob->exec(signature, signedData);
         QVERIFY(!verificationResult.error());
         QCOMPARE(verificationResult.numSignatures(), 1);
diff --git a/sanitizers.supp b/sanitizers.supp
index 32f7f80e..3a30fcbb 100644
--- a/sanitizers.supp
+++ b/sanitizers.supp
@@ -14,3 +14,4 @@ leak:QObject::QObject
 leak:QObjectPrivate::addConnection
 leak:QObjectPrivate::connectImpl
 leak:QPropertyAnimation::QPropertyAnimation
+leak:gpgme_op_verify_ext
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.