Browse Source

* Fix memleak in check

git-svn-id: trunk@38571 -
michael 7 years ago
parent
commit
65b39fa567
1 changed files with 8 additions and 4 deletions
  1. 8 4
      packages/fcl-report/src/fpreportdata.pp

+ 8 - 4
packages/fcl-report/src/fpreportdata.pp

@@ -698,10 +698,14 @@ begin
   else
   else
     begin
     begin
     H:=TFPCustomReportDataManager.GetTypeHandler(DataType);
     H:=TFPCustomReportDataManager.GetTypeHandler(DataType);
-    if H=Nil then
-      Result:=Format(SErrInvalidDataType,[DataType])
-    else
-      Result:=H.CheckConfig(Config);
+    try
+      if H=Nil then
+        Result:=Format(SErrInvalidDataType,[DataType])
+      else
+        Result:=H.CheckConfig(Config);
+    Finally
+      H.Free;
+    end;
     end;
     end;
 end;
 end;