From 3100eab80410144fc09a7a52ba3366ee5e14173a Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Mon, 24 Oct 2011 20:58:18 -0700 Subject: [PATCH] Apparently these need to be freed. Worth noting that Cyan never seems to do this anywhere... --- Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp index 9c884366..ec7ebdee 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp @@ -105,6 +105,7 @@ hsBool plFileUtils::CreateDir( const wchar *path ) #elif HS_BUILD_FOR_UNIX const char* cpath = hsWStringToString(path); CreateDir(cpath); + delete[] cpath; /* Free the string */ #endif } @@ -156,6 +157,7 @@ bool plFileUtils::RemoveFile(const wchar* filename, bool delReadOnly) #elif HS_BUILD_FOR_UNIX const char* cfilename = hsWStringToString(filename); RemoveFile(cfilename, delReadOnly); + delete[] cfilename; /* Free the string */ #endif } @@ -179,6 +181,8 @@ bool plFileUtils::FileCopy(const wchar* existingFile, const wchar* newFile) const char* cnew = hsWStringToString(newFile); FILE* fp = fopen(cexisting, "rb"); FILE* fw = fopen(cnew, "w"); + delete[] cexisting; + delete[] cnew; int num = 0; bool retVal = true; if (fp && fw){