diff --git a/packages/rtl-objpas/src/inc/rtti.pp b/packages/rtl-objpas/src/inc/rtti.pp index 62d6c2abe3..9af021157f 100644 --- a/packages/rtl-objpas/src/inc/rtti.pp +++ b/packages/rtl-objpas/src/inc/rtti.pp @@ -5954,7 +5954,11 @@ begin SetLength(FFields,Len); FFieldsResolved:=True; if Len=0 then + begin + if Assigned(Tbl) then + FreeMem(Tbl); exit; + end; Ctx:=TRttiContext.Create; try Ctx.UsePublishedOnly:=False;