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/resources/resourcemanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/resources/resourcemanager.cpp') 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(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; } -- cgit v1.2.3-60-g2f50