From 45386dcbafcc1e15b18941dc9b3f263ab40ec502 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 14:48:51 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Free=20the=20config=20document?= =?UTF-8?q?=20on=20validation=20failures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Invalid or outdated configuration leaked the parsed XML document while aborting startup. --- Server/UConfig.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Server/UConfig.pas b/Server/UConfig.pas index 769e8c8..61f0009 100644 --- a/Server/UConfig.pas +++ b/Server/UConfig.pas @@ -203,6 +203,7 @@ begin inherited Create; FFilename := AFilename; ReadXMLFile(xmlDoc, AFilename); + try version := 0; if not ((xmlDoc.DocumentElement.NodeName = 'CEDConfig') and TryStrToInt(xmlDoc.DocumentElement.AttribStrings['Version'], version) and @@ -236,9 +237,10 @@ begin else FMapStates := TMapStates.Create(Self); - xmlDoc.Free; - FChanged := False; + finally + xmlDoc.Free; + end; end; constructor TConfig.Init(AFilename: string);