mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-29 23:15:56 -04:00
attempt to fix a couple potential leaks...i'm rusty so forgive me if it's stupid
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user