summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-06-18 06:44:03 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-06-18 06:44:03 (GMT)
commitcfdfbb4d3c39ee1e728aa80da55c1f25d00be4d1 (patch)
tree18d17fd813accf0b6e6e9427f22ba372a7f8e78b /Objects
parent75a25867ab96f1fe8a4295775fbcbb171bde693b (diff)
downloadcpython-cfdfbb4d3c39ee1e728aa80da55c1f25d00be4d1.zip
cpython-cfdfbb4d3c39ee1e728aa80da55c1f25d00be4d1.tar.gz
cpython-cfdfbb4d3c39ee1e728aa80da55c1f25d00be4d1.tar.bz2
Issue #27342: Replaced some Py_XDECREFs with Py_DECREFs.
Patch by Xiang Zhang.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/rangeobject.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index 0e9eb20..f3ef44c 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -129,9 +129,9 @@ range_new(PyTypeObject *type, PyObject *args, PyObject *kw)
return (PyObject *) obj;
/* Failed to create object, release attributes */
- Py_XDECREF(start);
- Py_XDECREF(stop);
- Py_XDECREF(step);
+ Py_DECREF(start);
+ Py_DECREF(stop);
+ Py_DECREF(step);
return NULL;
}
@@ -196,7 +196,7 @@ compute_range_length(PyObject *start, PyObject *stop, PyObject *step)
/* if (lo >= hi), return length of 0. */
cmp_result = PyObject_RichCompareBool(lo, hi, Py_GE);
if (cmp_result != 0) {
- Py_XDECREF(step);
+ Py_DECREF(step);
if (cmp_result < 0)
return NULL;
return PyLong_FromLong(0);
@@ -225,9 +225,9 @@ compute_range_length(PyObject *start, PyObject *stop, PyObject *step)
return result;
Fail:
+ Py_DECREF(step);
Py_XDECREF(tmp2);
Py_XDECREF(diff);
- Py_XDECREF(step);
Py_XDECREF(tmp1);
Py_XDECREF(one);
return NULL;