From 6a72c5c38b62f7e837cf6fc4356d9f2054a6f34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Fri, 27 May 2022 16:41:14 +0200 Subject: [PATCH] Fix clang-analyzer-cplusplus.NewDelete (Use of memory after it is freed) --- src/game/editor/auto_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/editor/auto_map.cpp b/src/game/editor/auto_map.cpp index adef6723c..08f9e5ef2 100644 --- a/src/game/editor/auto_map.cpp +++ b/src/game/editor/auto_map.cpp @@ -537,7 +537,7 @@ void CAutoMapper::Proceed(CLayerTiles *pLayer, int ConfigID, int Seed, int SeedO } // clean-up - if(pRun->m_AutomapCopy) + if(pRun->m_AutomapCopy && pReadLayer != pLayer) delete pReadLayer; } }