Explorar o código

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

git-svn-id: trunk@5550 -

pierre %!s(int64=18) %!d(string=hai) anos
pai
achega
b486f926ce
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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;