From 4233574085add6bac54756eba8f0407135628129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 26 Jul 2023 15:32:58 +0200 Subject: [PATCH] Fix leak of map data when extracting map from demo fails --- src/engine/shared/demo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/engine/shared/demo.cpp b/src/engine/shared/demo.cpp index b29d526da..db27e699c 100644 --- a/src/engine/shared/demo.cpp +++ b/src/engine/shared/demo.cpp @@ -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);