[libraries/ktextaddons] texttranslator/translator/plugins/bergamot: Fix tar mem leak

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

Fix tar mem leak

M  +2    -0    texttranslator/translator/plugins/bergamot/extractlanguagejob.cpp

https://invent.kde.org/libraries/ktextaddons/-/commit/3f09f8fd66e9434f89cfff817d7215d565411081

diff --git a/texttranslator/translator/plugins/bergamot/extractlanguagejob.cpp b/texttranslator/translator/plugins/bergamot/extractlanguagejob.cpp
index 3a479b803..56c17c245 100644
--- a/texttranslator/translator/plugins/bergamot/extractlanguagejob.cpp
+++ b/texttranslator/translator/plugins/bergamot/extractlanguagejob.cpp
@@ -38,12 +38,14 @@ void ExtractLanguageJob::start()
     if (!tar->open(QIODevice::ReadOnly)) {
         qCWarning(TRANSLATOR_LIBBERGAMOT_LOG) << "Impossible to open temporary file" << mSource;
         Q_EMIT finished();
+        delete tar;
         deleteLater();
         return;
     }
     if (!QDir().mkpath(BergamotEngineUtils::storageLanguagePath())) {
         qCWarning(TRANSLATOR_LIBBERGAMOT_LOG) << "Impossible to create path" << BergamotEngineUtils::storageLanguagePath();
         Q_EMIT finished();
+        delete tar;
         deleteLater();
         return;
     }
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.