Skip to content

Commit

Permalink
Fix refcount bug in Row.__repr__
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleehammer committed Apr 14, 2023
1 parent 92818cc commit 4c385cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,10 @@ static PyObject* Row_repr(PyObject* o)
if (!tmp)
return 0;

for (Py_ssize_t i = 0; i < self->cValues; i++)
for (Py_ssize_t i = 0; i < self->cValues; i++) {
Py_INCREF(self->apValues[i]);
PyTuple_SET_ITEM(tmp.Get(), i, self->apValues[i]);
}

return PyObject_Repr(tmp);
}
Expand Down

0 comments on commit 4c385cf

Please # to comment.