File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1643,7 +1643,7 @@ static PyObject *Connection_NewCursor(
1643
1643
PyObject * args , // arguments
1644
1644
PyObject * keywordArgs ) // keyword arguments
1645
1645
{
1646
- PyObject * createArgs , * result ;
1646
+ PyObject * createArgs , * result , * arg ;
1647
1647
Py_ssize_t numArgs = 0 , i ;
1648
1648
1649
1649
if (args )
@@ -1653,8 +1653,11 @@ static PyObject *Connection_NewCursor(
1653
1653
return NULL ;
1654
1654
Py_INCREF (self );
1655
1655
PyTuple_SET_ITEM (createArgs , 0 , (PyObject * ) self );
1656
- for (i = 0 ; i < numArgs ; i ++ )
1657
- PyTuple_SET_ITEM (createArgs , i + 1 , PyTuple_GET_ITEM (args , i ));
1656
+ for (i = 0 ; i < numArgs ; i ++ ) {
1657
+ arg = PyTuple_GET_ITEM (args , i );
1658
+ Py_INCREF (arg );
1659
+ PyTuple_SET_ITEM (createArgs , i + 1 , arg );
1660
+ }
1658
1661
result = PyObject_Call ( (PyObject * ) & g_CursorType , createArgs ,
1659
1662
keywordArgs );
1660
1663
Py_DECREF (createArgs );
You can’t perform that action at this time.
0 commit comments