summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/updaterwindow.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 6dbc03852..c4f085292 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -1070,11 +1070,12 @@ bool UpdaterWindow::validateFile(const std::string &filePath,
unsigned long UpdaterWindow::getFileHash(const std::string &filePath)
{
int size = 0;
- const char *const buf = static_cast<const char*>(
- VirtFs::loadFile(filePath, size));
- if (!buf)
+ char *const buf = VirtFs::loadFile(filePath, size);
+ if (buf == nullptr)
return 0;
- return Net::Download::adlerBuffer(buf, size);
+ unsigned long res = Net::Download::adlerBuffer(buf, size);
+ delete [] buf;
+ return res;
}
void UpdaterWindow::loadFile(std::string file)