Browse Source

* taddnode.first_addstring, avoid memory leak if
left or right is an empty string.

git-svn-id: trunk@5550 -

pierre 19 năm trước cách đây
mục cha
commit
b486f926ce
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      compiler/nadd.pas

+ 2 - 0
compiler/nadd.pas

@@ -1596,6 +1596,7 @@ implementation
               if (left.nodetype=stringconstn) and (tstringconstnode(left).len=0) then
                 begin
                   result:=right;
+                  left.free;
                   left:=nil;
                   right:=nil;
                   exit;
@@ -1604,6 +1605,7 @@ implementation
                 begin
                   result:=left;
                   left:=nil;
+                  right.free;
                   right:=nil;
                   exit;
                 end;