[network/ruqola] src/core/encryption: Fix mem leak

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 3c331cfc68c489afc04cc98e78ead766a89fe7e5 by Laurent Montel.
Committed on 03/08/2026 at 05:40.
Pushed by mlaurent into branch 'master'.

Fix mem leak

M  +1    -0    src/core/encryption/encryptionutils.cpp

https://invent.kde.org/network/ruqola/-/commit/3c331cfc68c489afc04cc98e78ead766a89fe7e5

diff --git a/src/core/encryption/encryptionutils.cpp b/src/core/encryption/encryptionutils.cpp
index 8d997deb22..ee3442b399 100644
--- a/src/core/encryption/encryptionutils.cpp
+++ b/src/core/encryption/encryptionutils.cpp
@@ -314,6 +314,7 @@ RSA *EncryptionUtils::publicKeyFromPEM(const QByteArray &pem)
     RSA *rsa = PEM_read_bio_RSA_PUBKEY(bio, nullptr, nullptr, nullptr);
     if (!rsa) {
         qCWarning(RUQOLA_ENCRYPTION_LOG) << "PEM_read_bio_RSA_PUBKEY failed!";
+        BIO_free(bio);
         return nullptr;
     }
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.