Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2002-12

Bug in heaptrc

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

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 pnil then
      TraceFreeMem(p);
     P:=nil; // something like this is missing
     TraceReallocMem:=P;
     exit;
   end;

Mattias Gaertner

Reply by email