Commit 046d2cb2 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix mem leak found by asan

parent ad286a0a
Pipeline #24771 passed with stage
in 20 minutes and 59 seconds
......@@ -66,6 +66,7 @@ void FollowupReminderNoAnswerDialogTest::shouldAddItemInTreeList()
dlg.setInfo(lstInfo);
//We load invalid infos.
QCOMPARE(treeWidget->topLevelItemCount(), 0);
lstInfo.clear();
//Load valid infos
for (int i = 0; i < 10; ++i) {
......
......@@ -102,6 +102,8 @@ void FollowUpReminderInfoWidget::setInfo(const QList<FollowUpReminder::FollowUpR
for (FollowUpReminder::FollowUpReminderInfo *info : infoList) {
if (info->isValid()) {
createOrUpdateItem(info);
} else {
delete info;
}
}
}
......
......@@ -130,6 +130,7 @@ void PotentialPhishingEmailJobTest::shouldCreateCorrectListOfEmails()
PotentialPhishingEmailJob *job = new PotentialPhishingEmailJob;
job->setPotentialPhishingEmails(emails);
QCOMPARE(job->checkEmails(), createdListOfEmails);
delete job;
}
QTEST_MAIN(PotentialPhishingEmailJobTest)
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