mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-02 14:21:53 +01:00
codetools: expreval: fixed mem leak
git-svn-id: trunk@22824 -
This commit is contained in:
parent
691f65044f
commit
427177187f
@ -170,7 +170,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure ClearOperandValue(var V: TOperandValue); inline;
|
||||
procedure ClearOperandValue(out V: TOperandValue); inline;
|
||||
begin
|
||||
V.Free:=false;
|
||||
V.Value:=nil;
|
||||
@ -1183,6 +1183,7 @@ begin
|
||||
if Result<>'' then
|
||||
System.Move(Operand.Value^,Result[1],length(Result));
|
||||
end;
|
||||
FreeOperandValue(Operand);
|
||||
end;
|
||||
|
||||
function TExpressionEvaluator.EvalPChar(Expression: PChar; ExprLen: PtrInt;
|
||||
@ -1904,6 +1905,7 @@ var
|
||||
Operand: TOperandValue;
|
||||
begin
|
||||
Result:=EvalPChar(Expression,ExprLen,Operand) and OperandIsTrue(Operand);
|
||||
FreeOperandValue(Operand);
|
||||
end;
|
||||
|
||||
function TExpressionEvaluator.AsString: string;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user