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)
762762 if (self -> statement ) {
763763 rc = pysqlite_step (self -> statement -> st , self -> connection );
764764 if (PyErr_Occurred ()) {
765- (void )pysqlite_statement_reset (self -> statement );
766- Py_DECREF (next_row );
767- return NULL ;
765+ goto error ;
768766 }
769767 if (rc != SQLITE_DONE && rc != SQLITE_ROW ) {
770- (void )pysqlite_statement_reset (self -> statement );
771- Py_DECREF (next_row );
772768 _pysqlite_seterror (self -> connection -> db , NULL );
773- return NULL ;
769+ goto error ;
774770 }
775771
776772 if (rc == SQLITE_ROW ) {
777773 self -> locked = 1 ; // GH-80254: Prevent recursive use of cursors.
778774 self -> next_row = _pysqlite_fetch_one_row (self );
779775 self -> locked = 0 ;
780776 if (self -> next_row == NULL ) {
781- (void )pysqlite_statement_reset (self -> statement );
782- return NULL ;
777+ goto error ;
783778 }
784779 }
785780 }
786781
787782 return next_row ;
783+
784+ error :
785+ (void )pysqlite_statement_reset (self -> statement );
786+ Py_DECREF (next_row );
787+ return NULL ;
788788}
789789
790790PyObject * pysqlite_cursor_fetchone (pysqlite_Cursor * self , PyObject * args )
You can’t perform that action at this time.
0 commit comments