From 6bd054119be733a4a076db52ae50bb347cb723d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20Juliano=20M=C3=BCller?= Date: Fri, 24 Feb 2017 09:54:44 -0300 Subject: [PATCH] Problem solving with memory leak when reading request body. --- sources/MVCFramework.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/MVCFramework.pas b/sources/MVCFramework.pas index 1b57d7c3..e136d556 100644 --- a/sources/MVCFramework.pas +++ b/sources/MVCFramework.pas @@ -1646,7 +1646,8 @@ var begin if (FBody = '') then begin - {$IFDEF BERLINORBETTER} + Encoding := nil; + {$IFDEF BERLINORBETTER} if (FCharset = '') then begin SetLength(Buffer, 10); @@ -1675,6 +1676,8 @@ begin Encoding := TEncoding.GetEncoding(FCharset); FBody := Encoding.GetString(Buffer); {$ENDIF} + if Assigned(Encoding) then + Encoding.Free; end; Result := FBody; end;