Fixed a bug in MergeList where ReAllocMem was being called on an uninitialized pointer causing memory corruption

git-svn-id: trunk@10944 -
This commit is contained in:
andrew 2007-04-14 18:53:37 +00:00
parent 00f7098809
commit c9b22c0490

View File

@ -1163,7 +1163,7 @@ var
begin
if (List=nil) or (List.Count<=1) then exit;
ReAllocMem(MergeList,List.Count*SizeOf(Pointer));
MergeList:=AllocMem(List.Count*SizeOf(Pointer));
Sort(0,List.Count-1);
Freemem(MergeList);
end;
@ -1231,7 +1231,7 @@ var
begin
if (List=nil) or (List.Count<=1) then exit;
CurSize:=PtrInt(List.Count)*SizeOf(Pointer);
ReAllocMem(MergeList,CurSize);
MergeList:=AllocMem(CurSize);
FillChar(MergeList^,CurSize,0);
Sort(0,List.Count-1);
for i:=0 to List.Count-1 do MergeList[i]:='';