Commit c047b583 authored by Laurent Montel's avatar Laurent Montel 😁

Fix mem leak

parent d86ebb50
......@@ -203,7 +203,8 @@ EwsFolder* EwsFindFolderResponse::readFolder(QXmlStreamReader &reader)
if (!folder->isValid()) {
setErrorMsg(QStringLiteral("Failed to read EWS request - invalid %1 element.")
.arg(QStringLiteral("Folder")));
return 0;
delete folder;
return nullptr;
}
QVariant dn = (*folder)[EwsFolderFieldDisplayName];
if (!dn.isNull()) {
......
......@@ -267,7 +267,8 @@ EwsItem* EwsFindItemResponse::readItem(QXmlStreamReader &reader)
if (!item->isValid()) {
setErrorMsg(QStringLiteral("Failed to read EWS request - invalid %1 element.")
.arg(reader.name().toString()));
return 0;
delete item;
return nullptr;
}
} else {
qCWarning(EWSCLI_LOG).noquote() << QStringLiteral("Unsupported folder type %1").arg(reader.name().toString());
......
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