mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #3136
3136: Fix some asan issues r=Jupeyy a=def- Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
commit
2ba4d5d6cb
|
@ -3574,9 +3574,9 @@ const char *CServer::GetAnnouncementLine(char const *pFileName)
|
|||
|
||||
std::vector<char *> v;
|
||||
char *pLine;
|
||||
CLineReader *lr = new CLineReader();
|
||||
lr->Init(File);
|
||||
while((pLine = lr->Get()))
|
||||
CLineReader lr;
|
||||
lr.Init(File);
|
||||
while((pLine = lr.Get()))
|
||||
if(str_length(pLine))
|
||||
if(pLine[0] != '#')
|
||||
v.push_back(pLine);
|
||||
|
|
|
@ -591,6 +591,12 @@ CDataFileWriter::~CDataFileWriter()
|
|||
{
|
||||
free(m_pItemTypes);
|
||||
m_pItemTypes = 0;
|
||||
for(int i = 0; i < m_NumItems; i++)
|
||||
if(m_pItems[i].m_pData)
|
||||
free(m_pItems[i].m_pData);
|
||||
for(int i = 0; i < m_NumDatas; ++i)
|
||||
if(m_pDatas[i].m_pCompressedData)
|
||||
free(m_pDatas[i].m_pCompressedData);
|
||||
free(m_pItems);
|
||||
m_pItems = 0;
|
||||
free(m_pDatas);
|
||||
|
@ -895,9 +901,15 @@ int CDataFileWriter::Finish()
|
|||
|
||||
// free data
|
||||
for(int i = 0; i < m_NumItems; i++)
|
||||
{
|
||||
free(m_pItems[i].m_pData);
|
||||
m_pItems[i].m_pData = 0;
|
||||
}
|
||||
for(int i = 0; i < m_NumDatas; ++i)
|
||||
{
|
||||
free(m_pDatas[i].m_pCompressedData);
|
||||
m_pDatas[i].m_pCompressedData = 0;
|
||||
}
|
||||
|
||||
io_close(m_File);
|
||||
m_File = 0;
|
||||
|
|
Loading…
Reference in a new issue