mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-28 22:15:49 -04:00
recommit the innocuous fixes from cppcheck - the va_end calls were deleting pointers and breaking things further down the line
This commit is contained in:
@@ -79,7 +79,7 @@ bool ConsoleCommandParserGame::performParsing(const NetworkId & track, const Str
|
||||
if(argv.size() > 2)
|
||||
{
|
||||
unsigned int pid;
|
||||
sscanf(Unicode::wideToNarrow(argv[2]).c_str(), "%d", &pid);
|
||||
sscanf(Unicode::wideToNarrow(argv[2]).c_str(), "%u", &pid);
|
||||
GameServerConnection * gameConn = CentralServer::getInstance().getGameServer(pid);
|
||||
if(gameConn)
|
||||
{
|
||||
|
||||
@@ -217,8 +217,8 @@ bool VisibleExpandableEntry::pruneInvisibleChildren()
|
||||
for (Children::iterator i = m_children.begin(); i != m_children.end(); )
|
||||
if ((*i)->m_visible == false)
|
||||
{
|
||||
delete *i;
|
||||
m_children.erase(i);
|
||||
delete *i;
|
||||
}
|
||||
else
|
||||
++i;
|
||||
|
||||
@@ -278,9 +278,9 @@ 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 +299,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;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
@@ -1167,7 +1167,7 @@ bool TargaFormat::saveImage(const Image &image, const char *filename)
|
||||
//---------------------------------------------------
|
||||
|
||||
f = fopen(filename, "wb");
|
||||
if (!f)
|
||||
if (f==NULL)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Unable to open Targa destination file %s.\n", filename));
|
||||
return false;
|
||||
|
||||
@@ -253,7 +253,7 @@ bool PaletteArgb::write(const char *pathName) const
|
||||
|
||||
// open file
|
||||
FILE *const file = fopen(pathName, "wb");
|
||||
if (!file)
|
||||
if (file==NULL)
|
||||
{
|
||||
WARNING(true, ("failed to open file [%s] for writing.", pathName));
|
||||
return false;
|
||||
|
||||
@@ -96,7 +96,7 @@ addrList()
|
||||
if (errno != EINVAL || lastReqSize != 0)
|
||||
{
|
||||
WARNING(true, ("Error getting interface list: %s", strerror(errno)));
|
||||
delete buf;
|
||||
delete [] buf;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -151,10 +151,10 @@ CSAssistGameAPIcore::CSAssistGameAPIcore(CSAssistGameAPI *api, const char *serve
|
||||
m_serverList.push_back(sid);
|
||||
}
|
||||
//fprintf(stderr, "res=%d, p=%s, host=%s, port=%d, size=%d\n", res, p, host, port, m_serverList.size());
|
||||
delete p;
|
||||
delete [] p;
|
||||
}
|
||||
delete host;
|
||||
delete buf;
|
||||
delete [] host;
|
||||
delete [] buf;
|
||||
m_curServer = m_serverList.begin();
|
||||
GetLBHost();
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user