From 033a6162914b8f6cdea446751160ca81fbd4c1ca Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 23 Oct 2013 19:50:09 +0300 Subject: replace some malloc/free by new/delete. --- src/net/download.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/net') 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(malloc(fileSize)); + char *const buffer = new char[fileSize]; if (!buffer) return 0; const uInt read = static_cast(fread(buffer, 1, fileSize, file)); unsigned long adler = adler32(0L, Z_NULL, 0); adler = adler32(static_cast(adler), reinterpret_cast(buffer), read); - free(buffer); - + delete [] buffer; return adler; } -- cgit v1.2.3-70-g09d2