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 @@ -773,29 +773,29 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self)
773773 if (self -> statement ) {
774774 rc = pysqlite_step (self -> statement -> st , self -> connection );
775775 if (PyErr_Occurred ()) {
776- (void )pysqlite_statement_reset (self -> statement );
777- Py_DECREF (next_row );
778- return NULL ;
776+ goto error ;
779777 }
780778 if (rc != SQLITE_DONE && rc != SQLITE_ROW ) {
781- (void )pysqlite_statement_reset (self -> statement );
782- Py_DECREF (next_row );
783779 _pysqlite_seterror (self -> connection -> db , NULL );
784- return NULL ;
780+ goto error ;
785781 }
786782
787783 if (rc == SQLITE_ROW ) {
788784 self -> locked = 1 ; // GH-80254: Prevent recursive use of cursors.
789785 self -> next_row = _pysqlite_fetch_one_row (self );
790786 self -> locked = 0 ;
791787 if (self -> next_row == NULL ) {
792- (void )pysqlite_statement_reset (self -> statement );
793- return NULL ;
788+ goto error ;
794789 }
795790 }
796791 }
797792
798793 return next_row ;
794+
795+ error :
796+ (void )pysqlite_statement_reset (self -> statement );
797+ Py_DECREF (next_row );
798+ return NULL ;
799799}
800800
801801PyObject * pysqlite_cursor_fetchone (pysqlite_Cursor * self , PyObject * args )
You can’t perform that action at this time.
0 commit comments