From 3f24194d7219db6d82ac9307b31a297ad7f149b2 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Sun, 14 Nov 2021 01:21:40 +0700 Subject: [PATCH] Fix memory leak in `JSONPointer` --- sources/Text/JSON/JSONPointer.uc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/Text/JSON/JSONPointer.uc b/sources/Text/JSON/JSONPointer.uc index 74ec1c1..1b10ddc 100644 --- a/sources/Text/JSON/JSONPointer.uc +++ b/sources/Text/JSON/JSONPointer.uc @@ -204,7 +204,9 @@ public final function Text Pop(optional bool doNotRemove) else { result = components[lastIndex].asText.Copy(); } - if (!doNotRemove) { + if (!doNotRemove) + { + _.memory.Free(components[lastIndex].asText); components.length = components.length - 1; } return result;