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 @@ -822,29 +822,29 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
822
822
if (self -> statement ) {
823
823
rc = pysqlite_step (self -> statement -> st , self -> connection );
824
824
if (PyErr_Occurred ()) {
825
- (void )pysqlite_statement_reset (self -> statement );
826
- Py_DECREF (next_row );
827
- return NULL ;
825
+ goto error ;
828
826
}
829
827
if (rc != SQLITE_DONE && rc != SQLITE_ROW ) {
830
- (void )pysqlite_statement_reset (self -> statement );
831
- Py_DECREF (next_row );
832
828
_pysqlite_seterror (self -> connection -> db , NULL );
833
- return NULL ;
829
+ goto error ;
834
830
}
835
831
836
832
if (rc == SQLITE_ROW ) {
837
833
self -> locked = 1 ; // GH-80254: Prevent recursive use of cursors.
838
834
self -> next_row = _pysqlite_fetch_one_row (self );
839
835
self -> locked = 0 ;
840
836
if (self -> next_row == NULL ) {
841
- (void )pysqlite_statement_reset (self -> statement );
842
- return NULL ;
837
+ goto error ;
843
838
}
844
839
}
845
840
}
846
841
847
842
return next_row ;
843
+
844
+ error :
845
+ (void )pysqlite_statement_reset (self -> statement );
846
+ Py_DECREF (next_row );
847
+ return NULL ;
848
848
}
849
849
850
850
/*[clinic input]
You can’t perform that action at this time.
0 commit comments