1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 18:59:09 +00:00

Apparently these need to be freed.

Worth noting that Cyan never seems to do this anywhere...
This commit is contained in:
Darryl Pogue
2011-10-24 20:58:18 -07:00
parent de9d463563
commit 3100eab804

View File

@ -105,6 +105,7 @@ hsBool plFileUtils::CreateDir( const wchar *path )
#elif HS_BUILD_FOR_UNIX #elif HS_BUILD_FOR_UNIX
const char* cpath = hsWStringToString(path); const char* cpath = hsWStringToString(path);
CreateDir(cpath); CreateDir(cpath);
delete[] cpath; /* Free the string */
#endif #endif
} }
@ -156,6 +157,7 @@ bool plFileUtils::RemoveFile(const wchar* filename, bool delReadOnly)
#elif HS_BUILD_FOR_UNIX #elif HS_BUILD_FOR_UNIX
const char* cfilename = hsWStringToString(filename); const char* cfilename = hsWStringToString(filename);
RemoveFile(cfilename, delReadOnly); RemoveFile(cfilename, delReadOnly);
delete[] cfilename; /* Free the string */
#endif #endif
} }
@ -179,6 +181,8 @@ bool plFileUtils::FileCopy(const wchar* existingFile, const wchar* newFile)
const char* cnew = hsWStringToString(newFile); const char* cnew = hsWStringToString(newFile);
FILE* fp = fopen(cexisting, "rb"); FILE* fp = fopen(cexisting, "rb");
FILE* fw = fopen(cnew, "w"); FILE* fw = fopen(cnew, "w");
delete[] cexisting;
delete[] cnew;
int num = 0; int num = 0;
bool retVal = true; bool retVal = true;
if (fp && fw){ if (fp && fw){