Selaa lähdekoodia

* Check against operation on unopend statement, patch from Lacak2 Mantis #19943

git-svn-id: trunk@18949 -
marco 14 vuotta sitten
vanhempi
commit
3383db43cd
1 muutettua tiedostoa jossa 7 lisäystä ja 6 poistoa
  1. 7 6
      packages/fcl-db/src/sqldb/interbase/ibconnection.pp

+ 7 - 6
packages/fcl-db/src/sqldb/interbase/ibconnection.pp

@@ -615,12 +615,13 @@ procedure TIBConnection.UnPrepareStatement(cursor : TSQLCursor);
 
 
 begin
 begin
   with cursor as TIBcursor do
   with cursor as TIBcursor do
-    begin
-    if isc_dsql_free_statement(@Status[0], @Statement, DSQL_Drop) <> 0 then
-      CheckError('FreeStatement', Status);
-    Statement := nil;
-    FPrepared := False;
-    end;
+    if assigned(Statement) Then
+      begin
+        if isc_dsql_free_statement(@Status[0], @Statement, DSQL_Drop) <> 0 then
+          CheckError('FreeStatement', Status);
+        Statement := nil;
+        FPrepared := False;
+      end;
 end;
 end;
 
 
 procedure TIBConnection.FreeSQLDABuffer(var aSQLDA : PXSQLDA);
 procedure TIBConnection.FreeSQLDABuffer(var aSQLDA : PXSQLDA);