diff options
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; } |