summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-18 17:56:11 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-18 17:56:11 +0200
commit1032dcdc6cb7084db493cb5f88bd5cade17e2fdf (patch)
tree139aed0abde8bb1a56522d402d233ea7d36f66ee
parent5202a06a431047ffa7838d7532788e13188228cf (diff)
downloadmana-1032dcdc6cb7084db493cb5f88bd5cade17e2fdf.tar.gz
mana-1032dcdc6cb7084db493cb5f88bd5cade17e2fdf.tar.bz2
mana-1032dcdc6cb7084db493cb5f88bd5cade17e2fdf.tar.xz
mana-1032dcdc6cb7084db493cb5f88bd5cade17e2fdf.zip
Don't leak the music file after copying it
-rw-r--r--src/resources/resourcemanager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index f7a2586e..0b8d6c35 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -442,10 +442,12 @@ bool ResourceManager::copyFile(const std::string &src, const std::string &dst)
PHYSFS_close(srcFile);
PHYSFS_close(dstFile);
+ free(buf);
return true;
}
-std::vector<std::string> ResourceManager::loadTextFile(const std::string &fileName)
+std::vector<std::string> ResourceManager::loadTextFile(
+ const std::string &fileName)
{
int contentsLength;
char *fileContents = (char*)loadFile(fileName, contentsLength);