From f15e704ce2c7bf9a025fed417f8e7998c3ff17e3 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 22 Aug 2023 03:12:59 +0700 Subject: [PATCH] Fix usage of freed object --- sources/BaseAPI/API/Commands/CommandParser.uc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/BaseAPI/API/Commands/CommandParser.uc b/sources/BaseAPI/API/Commands/CommandParser.uc index 2817045..190e755 100644 --- a/sources/BaseAPI/API/Commands/CommandParser.uc +++ b/sources/BaseAPI/API/Commands/CommandParser.uc @@ -627,6 +627,7 @@ private final function HashTable AutoResolveAlias(MutableText textValue, Text al _.memory.Free(immutableValue); // Add "value" key only after we've checked for "$" prefix if (!textValue.StartsWithS("$")) { + result.SetItem(P("value"), immutableValue); return result; } if (aliasSourceName.Compare(P("weapon"))) { @@ -641,7 +642,7 @@ private final function HashTable AutoResolveAlias(MutableText textValue, Text al resolvedValue = _.alias.ResolveCustom(aliasSourceName, textValue, true); } result.SetItem(P("value"), resolvedValue); - _.memory.Free2(resolvedValue, immutableValue); + _.memory.Free(resolvedValue); return result; }