Skip to content

Commit

Permalink
- fixed memory leak in UDMF loader.
Browse files Browse the repository at this point in the history
When the extsector allocation was moved, this hadn't been adjusted yet, it still allocated its own buffer which never got freed again.
  • Loading branch information
coelckers committed Mar 4, 2021
1 parent 357163c commit ecc4d31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/maploader/udmf.cpp
Expand Up @@ -2318,10 +2318,10 @@ class UDMFParser : public UDMFParserBase
// Create the real sectors
Level->sectors.Alloc(ParsedSectors.Size());
memcpy(&Level->sectors[0], &ParsedSectors[0], Level->sectors.Size() * sizeof(sector_t));
Level->sectors[0].e = new extsector_t[Level->sectors.Size()];
Level->extsectors.Alloc(Level->sectors.Size());
for(unsigned i = 0; i < Level->sectors.Size(); i++)
{
Level->sectors[i].e = &Level->sectors[0].e[i];
Level->sectors[i].e = &Level->extsectors[i];
}
// Now create the scrollers.
for (auto &scroll : UDMFScrollers)
Expand Down

0 comments on commit ecc4d31

Please sign in to comment.