diff options
author | Alexander Tkachev | 2016-07-20 17:30:19 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | a449ddce15c512e809b9aedad334db6b52628e61 (patch) | |
tree | b40883e0122db298ef294dedf650bcb656befd7f /backends/cloud | |
parent | c7fe842f9acf0eeec5453170699ed10394ef0fa5 (diff) | |
download | scummvm-rg350-a449ddce15c512e809b9aedad334db6b52628e61.tar.gz scummvm-rg350-a449ddce15c512e809b9aedad334db6b52628e61.tar.bz2 scummvm-rg350-a449ddce15c512e809b9aedad334db6b52628e61.zip |
CLOUD: Fix Cppcheck warnings
Diffstat (limited to 'backends/cloud')
-rw-r--r-- | backends/cloud/cloudmanager.cpp | 1 | ||||
-rw-r--r-- | backends/cloud/dropbox/dropboxstorage.cpp | 2 | ||||
-rw-r--r-- | backends/cloud/dropbox/dropboxuploadrequest.cpp | 4 | ||||
-rw-r--r-- | backends/cloud/googledrive/googledriveuploadrequest.cpp | 2 | ||||
-rw-r--r-- | backends/cloud/onedrive/onedriveuploadrequest.cpp | 2 |
5 files changed, 6 insertions, 5 deletions
diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp index ed48ec5079..3e1c94f909 100644 --- a/backends/cloud/cloudmanager.cpp +++ b/backends/cloud/cloudmanager.cpp @@ -240,6 +240,7 @@ void CloudManager::connectStorage(uint32 index, Common::String code) { // in these constructors Storages request token using the passed code // when the token is received, they call replaceStorage() // or removeStorage(), if some error occurred + // thus, no memory leak happens } void CloudManager::printBool(Storage::BoolResponse response) const { diff --git a/backends/cloud/dropbox/dropboxstorage.cpp b/backends/cloud/dropbox/dropboxstorage.cpp index 4171af0443..d7aea012af 100644 --- a/backends/cloud/dropbox/dropboxstorage.cpp +++ b/backends/cloud/dropbox/dropboxstorage.cpp @@ -135,7 +135,7 @@ Networking::Request *DropboxStorage::streamFileById(Common::String path, Network Networking::NetworkReadStreamResponse response = request->execute(); if (callback) (*callback)(response); - return response.request; + return response.request; // no leak here, response.request == request } Networking::Request *DropboxStorage::createDirectory(Common::String path, BoolCallback callback, Networking::ErrorCallback errorCallback) { diff --git a/backends/cloud/dropbox/dropboxuploadrequest.cpp b/backends/cloud/dropbox/dropboxuploadrequest.cpp index a3d7dd0d6d..ee6f665665 100644 --- a/backends/cloud/dropbox/dropboxuploadrequest.cpp +++ b/backends/cloud/dropbox/dropboxuploadrequest.cpp @@ -137,10 +137,10 @@ void DropboxUploadRequest::partUploadedCallback(Networking::JsonResponse respons //debug("%s", json->stringify(true).c_str()); if (object.contains("error") || object.contains("error_summary")) { - warning("Dropbox returned error: %s", object.getVal("error_summary")->asString().c_str()); - delete json; + warning("Dropbox returned error: %s", object.getVal("error_summary")->asString().c_str()); error.response = json->stringify(true); finishError(error); + delete json; return; } diff --git a/backends/cloud/googledrive/googledriveuploadrequest.cpp b/backends/cloud/googledrive/googledriveuploadrequest.cpp index 73a7fbfcac..dfff46c0d2 100644 --- a/backends/cloud/googledrive/googledriveuploadrequest.cpp +++ b/backends/cloud/googledrive/googledriveuploadrequest.cpp @@ -266,9 +266,9 @@ void GoogleDriveUploadRequest::partUploadedCallback(Networking::JsonResponse res if (object.contains("error")) { warning("GoogleDrive returned error: %s", json->stringify(true).c_str()); - delete json; error.response = json->stringify(true); finishError(error); + delete json; return; } diff --git a/backends/cloud/onedrive/onedriveuploadrequest.cpp b/backends/cloud/onedrive/onedriveuploadrequest.cpp index 5b86c6c988..500f875b9d 100644 --- a/backends/cloud/onedrive/onedriveuploadrequest.cpp +++ b/backends/cloud/onedrive/onedriveuploadrequest.cpp @@ -127,9 +127,9 @@ void OneDriveUploadRequest::partUploadedCallback(Networking::JsonResponse respon if (object.contains("error")) { warning("OneDrive returned error: %s", json->stringify(true).c_str()); - delete json; error.response = json->stringify(true); finishError(error); + delete json; return; } |