[fpc-devel]Bug in heaptrc

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Dec 24 13:56:33 CET 2002


Hi all,

There is a bug in the heaptrc unit (1.0 and 1.1).
ReAllocMem(p,0) does not set p to nil.

function TraceReAllocMem(var p:pointer;size:longint):Pointer;
var
  [...]
begin
{ Free block? }
  if size=0 then
   begin
     if p<>nil then
      TraceFreeMem(p);
     P:=nil; // something like this is missing
     TraceReallocMem:=P;
     exit;
   end;



Mattias Gaertner




More information about the fpc-devel mailing list