mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
plug reference leak
This commit is contained in:
parent
00fa03900c
commit
547d4859b9
1 changed files with 4 additions and 2 deletions
|
|
@ -307,11 +307,13 @@ compute_range_item(rangeobject *r, PyObject *arg)
|
||||||
static PyObject *
|
static PyObject *
|
||||||
range_item(rangeobject *r, Py_ssize_t i)
|
range_item(rangeobject *r, Py_ssize_t i)
|
||||||
{
|
{
|
||||||
PyObject *arg = PyLong_FromLong(i);
|
PyObject *res, *arg = PyLong_FromLong(i);
|
||||||
if (!arg) {
|
if (!arg) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return compute_range_item(r, arg);
|
res = compute_range_item(r, arg);
|
||||||
|
Py_DECREF(arg);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Additional helpers, since the standard slice helpers
|
/* Additional helpers, since the standard slice helpers
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue