attempt to fix a couple potential leaks...i'm rusty so forgive me if it's stupid

This commit is contained in:
CodeCodon
2015-07-26 16:35:50 -05:00
parent 2023cdd5db
commit 25c7563750
2 changed files with 3 additions and 5 deletions
@@ -278,9 +278,8 @@ void FileManifest::addNewManifestEntry(const char *fileName, int fileSize)
if (fileSize)
((insertReturn.first)->second)->size = fileSize;
// delete the new entry we created
delete entry;
}
delete entry;
#else
return;
#endif
@@ -299,9 +298,7 @@ void FileManifest::addStoredManifestEntry(const char *fileName, const char * sce
std::pair<ManifestMap::iterator, bool> insertReturn = s_manifest.insert(std::pair<const uint32, FileManifestEntry*>(crc, entry));
// if the insert failed, delete the entry we created
if (!insertReturn.second)
delete entry;
delete entry;
}
// -----------------------------------------------------------------------
+1
View File
@@ -31,6 +31,7 @@ bool CConfig::LoadFile(char * file)
if (fp == NULL || fp == (FILE *)-1)
{
//fprintf(stderr,"Failed to open config file %s!",file);
delete fp;
return false;
}