diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-18 17:56:11 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-18 17:56:11 +0200 |
commit | 1032dcdc6cb7084db493cb5f88bd5cade17e2fdf (patch) | |
tree | 139aed0abde8bb1a56522d402d233ea7d36f66ee /src | |
parent | 5202a06a431047ffa7838d7532788e13188228cf (diff) | |
download | mana-client-1032dcdc6cb7084db493cb5f88bd5cade17e2fdf.tar.gz mana-client-1032dcdc6cb7084db493cb5f88bd5cade17e2fdf.tar.bz2 mana-client-1032dcdc6cb7084db493cb5f88bd5cade17e2fdf.tar.xz mana-client-1032dcdc6cb7084db493cb5f88bd5cade17e2fdf.zip |
Don't leak the music file after copying it
Diffstat (limited to 'src')
-rw-r--r-- | src/resources/resourcemanager.cpp | 4 |
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); |