plug reference leak
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index ee42ba9..979a62a 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -307,11 +307,13 @@
static PyObject *
range_item(rangeobject *r, Py_ssize_t i)
{
- PyObject *arg = PyLong_FromLong(i);
+ PyObject *res, *arg = PyLong_FromLong(i);
if (!arg) {
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