It is probably not a bug where you think it is. The heap tracing of FPC has known issues with tracking temps (and automated types in general) in main programs (the main .dpr begin..end).
Move the code to a procedure, and call that from the main begin..end. and you'll see the leak disappears.
This because the general structure of the main program is like
begin
initializeunits(); // procedure call inserted by the compiler
<actual mainprogram statements>
finalizeunits(); // procedure call inserted by the compiler
end.
with the releasing of mainprogram temps happening at "end." after finalizeunits that finalizes the heaptracking. (even if it is first unit, it is still only an unit). So heaptrc misses that.