Merge pull request #73 from ezequieljuliano/master

Problem solving with memory leak when reading request body.
This commit is contained in:
Daniele Teti 2017-02-24 14:14:49 +01:00 committed by GitHub
commit 2830fef1b7

View File

@ -1646,7 +1646,8 @@ var
begin begin
if (FBody = '') then if (FBody = '') then
begin begin
{$IFDEF BERLINORBETTER} Encoding := nil;
{$IFDEF BERLINORBETTER}
if (FCharset = '') then if (FCharset = '') then
begin begin
SetLength(Buffer, 10); SetLength(Buffer, 10);
@ -1675,6 +1676,8 @@ begin
Encoding := TEncoding.GetEncoding(FCharset); Encoding := TEncoding.GetEncoding(FCharset);
FBody := Encoding.GetString(Buffer); FBody := Encoding.GetString(Buffer);
{$ENDIF} {$ENDIF}
if Assigned(Encoding) then
Encoding.Free;
end; end;
Result := FBody; Result := FBody;
end; end;