mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 19:29:09 +02:00
* taddnode.first_addstring, avoid memory leak if
left or right is an empty string. git-svn-id: trunk@5550 -
This commit is contained in:
parent
501f66e0ca
commit
b486f926ce
@ -1596,6 +1596,7 @@ implementation
|
|||||||
if (left.nodetype=stringconstn) and (tstringconstnode(left).len=0) then
|
if (left.nodetype=stringconstn) and (tstringconstnode(left).len=0) then
|
||||||
begin
|
begin
|
||||||
result:=right;
|
result:=right;
|
||||||
|
left.free;
|
||||||
left:=nil;
|
left:=nil;
|
||||||
right:=nil;
|
right:=nil;
|
||||||
exit;
|
exit;
|
||||||
@ -1604,6 +1605,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
result:=left;
|
result:=left;
|
||||||
left:=nil;
|
left:=nil;
|
||||||
|
right.free;
|
||||||
right:=nil;
|
right:=nil;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user