Browse Source

* Remove additional memleak

Michaël Van Canneyt 1 year ago
parent
commit
bc2d1cf51c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/rtl-objpas/src/inc/rtti.pp

+ 4 - 0
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;