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 @@ -822,29 +822,29 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
822822 if (self -> statement ) {
823823 rc = pysqlite_step (self -> statement -> st , self -> connection );
824824 if (PyErr_Occurred ()) {
825- (void )pysqlite_statement_reset (self -> statement );
826- Py_DECREF (next_row );
827- return NULL ;
825+ goto error ;
828826 }
829827 if (rc != SQLITE_DONE && rc != SQLITE_ROW ) {
830- (void )pysqlite_statement_reset (self -> statement );
831- Py_DECREF (next_row );
832828 _pysqlite_seterror (self -> connection -> db , NULL );
833- return NULL ;
829+ goto error ;
834830 }
835831
836832 if (rc == SQLITE_ROW ) {
837833 self -> locked = 1 ; // GH-80254: Prevent recursive use of cursors.
838834 self -> next_row = _pysqlite_fetch_one_row (self );
839835 self -> locked = 0 ;
840836 if (self -> next_row == NULL ) {
841- (void )pysqlite_statement_reset (self -> statement );
842- return NULL ;
837+ goto error ;
843838 }
844839 }
845840 }
846841
847842 return next_row ;
843+
844+ error :
845+ (void )pysqlite_statement_reset (self -> statement );
846+ Py_DECREF (next_row );
847+ return NULL ;
848848}
849849
850850/*[clinic input]
You can’t perform that action at this time.
0 commit comments