Pārlūkot izejas kodu

* Merging revisions r47343,r47344 from trunk:
------------------------------------------------------------------------
r47343 | michael | 2020-11-08 18:05:01 +0100 (Sun, 08 Nov 2020) | 1 line

* Fix bug #37852, possible memleak
------------------------------------------------------------------------
r47344 | michael | 2020-11-08 18:10:07 +0100 (Sun, 08 Nov 2020) | 1 line

* Correct line number
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@49320 -

michael 4 gadi atpakaļ
vecāks
revīzija
72195c84ef

+ 9 - 6
packages/fcl-db/src/sqldb/interbase/fbadmin.pp

@@ -392,13 +392,16 @@ end;
 
 destructor TFBAdmin.Destroy;
 begin
-  if FSvcHandle<>FB_API_NULLHANDLE then
-  begin
-    WaitInterval:=100;
-    DisConnect;
+  try
+    if FSvcHandle<>FB_API_NULLHANDLE then
+    begin
+      WaitInterval:=100;
+      DisConnect; // This can raise an exception
+    end;
+  Finally
+    FOutput.Destroy;
+    inherited Destroy;
   end;
-  FOutput.Destroy;
-  inherited Destroy;
 end;
 
 function TFBAdmin.Connect: boolean;

+ 2 - 0
packages/fcl-json/src/jsonscanner.pp

@@ -185,6 +185,8 @@ constructor TJSONScanner.Create(const aSource: RawByteString; AOptions: TJSONOpt
 begin
   FSource:=aSource;
   FCurPos:=PAnsiChar(FSource);
+  if FCurPos<>Nil then
+    FCurRow:=1;
   FOptions:=AOptions;
 end;