Răsfoiți Sursa

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

git-svn-id: trunk@5550 -

pierre 18 ani în urmă
părinte
comite
b486f926ce
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  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;