summaryrefslogtreecommitdiff
path: root/src/gui/windows/updaterwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-21 00:47:44 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-21 00:47:44 +0300
commitfffbd86a1014ad169ed2d68ea58cdddf346faa14 (patch)
tree713c96fcf7421ca87f638d312e752179281cb8fe /src/gui/windows/updaterwindow.cpp
parent1941b81a5a278f26a5d7e1f91903ab04c92e2cd1 (diff)
downloadManaVerse-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.gz
ManaVerse-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.bz2
ManaVerse-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.xz
ManaVerse-fffbd86a1014ad169ed2d68ea58cdddf346faa14.zip
Add missing checks and non null attributes.
Diffstat (limited to 'src/gui/windows/updaterwindow.cpp')
-rw-r--r--src/gui/windows/updaterwindow.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index e221b73b9..9330539ab 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -362,7 +362,11 @@ void UpdaterWindow::loadNews()
// Reallocate and include terminating 0 character
mMemoryBuffer = static_cast<char*>(realloc(
mMemoryBuffer, mDownloadedBytes + 1));
-
+ if (!mMemoryBuffer)
+ {
+ logger->log1("Couldn't load news");
+ return;
+ }
mMemoryBuffer[mDownloadedBytes] = '\0';
mBrowserBox->clearRows();
@@ -425,6 +429,11 @@ void UpdaterWindow::loadPatch()
// Reallocate and include terminating 0 character
mMemoryBuffer = static_cast<char*>(
realloc(mMemoryBuffer, mDownloadedBytes + 1));
+ if (!mMemoryBuffer)
+ {
+ logger->log1("Couldn't load patch");
+ return;
+ }
mMemoryBuffer[mDownloadedBytes] = '\0';
std::string version;