compiler: Variant initialized with PAnsiChar leaks memory on release
Original Reporter info from Mantis: AntonK
-
Reporter name: Anton Kavalenka
Original Reporter info from Mantis: AntonK
- Reporter name: Anton Kavalenka
Description:
The attached project compiled with heap tracer show memory leak of 1 block
/usr/local/lib/fpc/3.1.1/ppc386 -B -Mdelphi -ghlw vv.pas
The unit vartable.pas contains workaround
{$ifdef WORK_AROUND}
vv:=Value;
Result:=VarIsFloat(vv);^M
vv:=null;
{$else}
Result:=VarIsFloat(value);
{$endif}
i.e. copying the variant for analysis, then releasing it prevents memory leaking.
Steps to reproduce:
Run the attached project compiled with heap tracer
Mantis conversion info:
- Mantis ID: 30546
- Build: r34403
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: r34440 (#2d051f89)
- Monitored by: » Vincent (Vincent Snijders)