Commit 44a034ad authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix potential mem leak

parent 5cf70320
......@@ -84,16 +84,17 @@ bool FilterKMailArchive::importMessage(const KArchiveFile *file, const QString &
qApp->processEvents();
KMime::Message::Ptr newMessage(new KMime::Message());
newMessage->setContent(file->data());
newMessage->parse();
Akonadi::Collection collection = parseFolderString(folderPath);
const Akonadi::Collection collection = parseFolderString(folderPath);
if (!collection.isValid()) {
filterInfo()->addErrorLogEntry(i18n("Unable to retrieve folder for folder path %1.", folderPath));
return false;
}
KMime::Message::Ptr newMessage(new KMime::Message());
newMessage->setContent(file->data());
newMessage->parse();
if (filterInfo()->removeDupMessage()) {
KMime::Headers::MessageID *messageId = newMessage->messageID(false);
if (messageId && !messageId->asUnicodeString().isEmpty()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment