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 @@ -773,29 +773,29 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self)
773
773
if (self -> statement ) {
774
774
rc = pysqlite_step (self -> statement -> st , self -> connection );
775
775
if (PyErr_Occurred ()) {
776
- (void )pysqlite_statement_reset (self -> statement );
777
- Py_DECREF (next_row );
778
- return NULL ;
776
+ goto error ;
779
777
}
780
778
if (rc != SQLITE_DONE && rc != SQLITE_ROW ) {
781
- (void )pysqlite_statement_reset (self -> statement );
782
- Py_DECREF (next_row );
783
779
_pysqlite_seterror (self -> connection -> db , NULL );
784
- return NULL ;
780
+ goto error ;
785
781
}
786
782
787
783
if (rc == SQLITE_ROW ) {
788
784
self -> locked = 1 ; // GH-80254: Prevent recursive use of cursors.
789
785
self -> next_row = _pysqlite_fetch_one_row (self );
790
786
self -> locked = 0 ;
791
787
if (self -> next_row == NULL ) {
792
- (void )pysqlite_statement_reset (self -> statement );
793
- return NULL ;
788
+ goto error ;
794
789
}
795
790
}
796
791
}
797
792
798
793
return next_row ;
794
+
795
+ error :
796
+ (void )pysqlite_statement_reset (self -> statement );
797
+ Py_DECREF (next_row );
798
+ return NULL ;
799
799
}
800
800
801
801
PyObject * pysqlite_cursor_fetchone (pysqlite_Cursor * self , PyObject * args )
You can’t perform that action at this time.
0 commit comments