diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-23 19:50:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-23 19:50:09 +0300 |
commit | 033a6162914b8f6cdea446751160ca81fbd4c1ca (patch) | |
tree | 88495eb1523c113812f78bdc95ed0816a8ee9e86 /src/resources/resourcemanager.cpp | |
parent | 0dca3216743cd5deaffad45ca50fccd7280eb6bd (diff) | |
download | manaplus-033a6162914b8f6cdea446751160ca81fbd4c1ca.tar.gz manaplus-033a6162914b8f6cdea446751160ca81fbd4c1ca.tar.bz2 manaplus-033a6162914b8f6cdea446751160ca81fbd4c1ca.tar.xz manaplus-033a6162914b8f6cdea446751160ca81fbd4c1ca.zip |
replace some malloc/free by new/delete.
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r-- | src/resources/resourcemanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 6b93901d9..ebf2f94bd 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -968,13 +968,13 @@ bool ResourceManager::copyFile(const std::string &src, } const int fileSize = static_cast<const int>(PHYSFS_fileLength(srcFile)); - void *buf = malloc(fileSize); + void *buf = new char[fileSize]; PHYSFS_read(srcFile, buf, 1, fileSize); PHYSFS_write(dstFile, buf, 1, fileSize); PHYSFS_close(srcFile); PHYSFS_close(dstFile); - free(buf); + delete [] buf; return true; } |