mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix leak of map data when extracting map from demo fails
This commit is contained in:
parent
fd13ae5fd5
commit
4233574085
|
@ -882,7 +882,10 @@ bool CDemoPlayer::ExtractMap(class IStorage *pStorage)
|
|||
// save map
|
||||
IOHANDLE MapFile = pStorage->OpenFile(aMapFilename, IOFLAG_WRITE, IStorage::TYPE_SAVE);
|
||||
if(!MapFile)
|
||||
{
|
||||
free(pMapData);
|
||||
return false;
|
||||
}
|
||||
|
||||
io_write(MapFile, pMapData, m_MapInfo.m_Size);
|
||||
io_close(MapFile);
|
||||
|
|
Loading…
Reference in a new issue