summaryrefslogtreecommitdiff
path: root/src/net/download.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-23 19:50:09 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-23 19:50:09 +0300
commit033a6162914b8f6cdea446751160ca81fbd4c1ca (patch)
tree88495eb1523c113812f78bdc95ed0816a8ee9e86 /src/net/download.cpp
parent0dca3216743cd5deaffad45ca50fccd7280eb6bd (diff)
downloadmanaverse-033a6162914b8f6cdea446751160ca81fbd4c1ca.tar.gz
manaverse-033a6162914b8f6cdea446751160ca81fbd4c1ca.tar.bz2
manaverse-033a6162914b8f6cdea446751160ca81fbd4c1ca.tar.xz
manaverse-033a6162914b8f6cdea446751160ca81fbd4c1ca.zip
replace some malloc/free by new/delete.
Diffstat (limited to 'src/net/download.cpp')
-rw-r--r--src/net/download.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index 3f26aabe7..3ccff63c8 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -117,15 +117,14 @@ unsigned long Download::fadler32(FILE *const file)
rewind(file);
// Calculate Adler-32 checksum
- char *const buffer = static_cast<char*>(malloc(fileSize));
+ char *const buffer = new char[fileSize];
if (!buffer)
return 0;
const uInt read = static_cast<uInt>(fread(buffer, 1, fileSize, file));
unsigned long adler = adler32(0L, Z_NULL, 0);
adler = adler32(static_cast<uInt>(adler),
reinterpret_cast<Bytef*>(buffer), read);
- free(buffer);
-
+ delete [] buffer;
return adler;
}