summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-10-09 13:19:04 +0200
committerMontel Laurent <[email protected]>2017-10-09 13:19:04 +0200
commitc047b583e82acc17cd2be0dceab3eb95292c69cf (patch)
tree96cf597bb134752e5a9310f5429bbb4a0ae1e075
parentd86ebb50d88f2a2062d87e605e20f13d97af04a2 (diff)
Fix mem leak
-rw-r--r--resources/ews/ewsclient/ewsfindfolderrequest.cpp3
-rw-r--r--resources/ews/ewsclient/ewsfinditemrequest.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/resources/ews/ewsclient/ewsfindfolderrequest.cpp b/resources/ews/ewsclient/ewsfindfolderrequest.cpp
index 579936c..d55565a 100644
--- a/resources/ews/ewsclient/ewsfindfolderrequest.cpp
+++ b/resources/ews/ewsclient/ewsfindfolderrequest.cpp
@@ -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()) {
diff --git a/resources/ews/ewsclient/ewsfinditemrequest.cpp b/resources/ews/ewsclient/ewsfinditemrequest.cpp
index 5adce4a..599d216 100644
--- a/resources/ews/ewsclient/ewsfinditemrequest.cpp
+++ b/resources/ews/ewsclient/ewsfinditemrequest.cpp
@@ -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());