diff options
Diffstat (limited to 'src/client/Client.cpp')
| -rw-r--r-- | src/client/Client.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp index ad5e458..4799d9a 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -813,7 +813,7 @@ SaveFile * Client::GetStamp(std::string stampID) size_t fileSize = stampFile.tellg(); stampFile.seekg(0); - unsigned char * tempData = (unsigned char *)malloc(fileSize); + unsigned char * tempData = new unsigned char[fileSize]; stampFile.read((char *)tempData, fileSize); stampFile.close(); @@ -826,8 +826,10 @@ SaveFile * Client::GetStamp(std::string stampID) } catch (ParseException & e) { + delete[] tempData; std::cerr << "Client: Invalid stamp file, " << stampID << " " << std::string(e.what()) << std::endl; } + delete[] tempData; return file; } else |
