File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -802,29 +802,29 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self)
802
802
if (self -> statement ) {
803
803
rc = pysqlite_step (self -> statement -> st , self -> connection );
804
804
if (PyErr_Occurred ()) {
805
- (void )pysqlite_statement_reset (self -> statement );
806
- Py_DECREF (next_row );
807
- return NULL ;
805
+ goto error ;
808
806
}
809
807
if (rc != SQLITE_DONE && rc != SQLITE_ROW ) {
810
- (void )pysqlite_statement_reset (self -> statement );
811
- Py_DECREF (next_row );
812
808
_pysqlite_seterror (self -> connection -> db , NULL );
813
- return NULL ;
809
+ goto error ;
814
810
}
815
811
816
812
if (rc == SQLITE_ROW ) {
817
813
self -> locked = 1 ; // GH-80254: Prevent recursive use of cursors.
818
814
self -> next_row = _pysqlite_fetch_one_row (self );
819
815
self -> locked = 0 ;
820
816
if (self -> next_row == NULL ) {
821
- (void )pysqlite_statement_reset (self -> statement );
822
- return NULL ;
817
+ goto error ;
823
818
}
824
819
}
825
820
}
826
821
827
822
return next_row ;
823
+
824
+ error :
825
+ (void )pysqlite_statement_reset (self -> statement );
826
+ Py_DECREF (next_row );
827
+ return NULL ;
828
828
}
829
829
830
830
PyObject * pysqlite_cursor_fetchone (pysqlite_Cursor * self , PyObject * args )
You can’t perform that action at this time.
0 commit comments