File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -762,29 +762,29 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self)
762
762
if (self -> statement ) {
763
763
rc = pysqlite_step (self -> statement -> st , self -> connection );
764
764
if (PyErr_Occurred ()) {
765
- (void )pysqlite_statement_reset (self -> statement );
766
- Py_DECREF (next_row );
767
- return NULL ;
765
+ goto error ;
768
766
}
769
767
if (rc != SQLITE_DONE && rc != SQLITE_ROW ) {
770
- (void )pysqlite_statement_reset (self -> statement );
771
- Py_DECREF (next_row );
772
768
_pysqlite_seterror (self -> connection -> db , NULL );
773
- return NULL ;
769
+ goto error ;
774
770
}
775
771
776
772
if (rc == SQLITE_ROW ) {
777
773
self -> locked = 1 ; // GH-80254: Prevent recursive use of cursors.
778
774
self -> next_row = _pysqlite_fetch_one_row (self );
779
775
self -> locked = 0 ;
780
776
if (self -> next_row == NULL ) {
781
- (void )pysqlite_statement_reset (self -> statement );
782
- return NULL ;
777
+ goto error ;
783
778
}
784
779
}
785
780
}
786
781
787
782
return next_row ;
783
+
784
+ error :
785
+ (void )pysqlite_statement_reset (self -> statement );
786
+ Py_DECREF (next_row );
787
+ return NULL ;
788
788
}
789
789
790
790
PyObject * pysqlite_cursor_fetchone (pysqlite_Cursor * self , PyObject * args )
You can’t perform that action at this time.
0 commit comments