From fffbd86a1014ad169ed2d68ea58cdddf346faa14 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 21 Jul 2015 00:47:44 +0300 Subject: Add missing checks and non null attributes. --- src/gui/windows/updaterwindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/gui/windows/updaterwindow.cpp') 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(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( realloc(mMemoryBuffer, mDownloadedBytes + 1)); + if (!mMemoryBuffer) + { + logger->log1("Couldn't load patch"); + return; + } mMemoryBuffer[mDownloadedBytes] = '\0'; std::string version; -- cgit v1.2.3-60-g2f50