summaryrefslogtreecommitdiffstats
path: root/Objects/sliceobject.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-10-17 17:10:24 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-10-17 17:10:24 (GMT)
commit897d05922102ff499d17b063e6f59ed1770091dc (patch)
tree194195b2cc52379ccecd6b114918e4c99c243e20 /Objects/sliceobject.c
parentf813080736433fe7cacffe782a3c209a720a09ff (diff)
parent2963fe07119c0dfa0d7fc42508912272c0100342 (diff)
downloadcpython-897d05922102ff499d17b063e6f59ed1770091dc.zip
cpython-897d05922102ff499d17b063e6f59ed1770091dc.tar.gz
cpython-897d05922102ff499d17b063e6f59ed1770091dc.tar.bz2
merge 3.2 (#13199)
Diffstat (limited to 'Objects/sliceobject.c')
-rw-r--r--Objects/sliceobject.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index 92464ab..2f5c045 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -347,9 +347,13 @@ slice_richcompare(PyObject *v, PyObject *w, int op)
}
t1 = PyTuple_New(3);
+ if (t1 == NULL)
+ return NULL;
t2 = PyTuple_New(3);
- if (t1 == NULL || t2 == NULL)
+ if (t2 == NULL) {
+ Py_DECREF(t1);
return NULL;
+ }
PyTuple_SET_ITEM(t1, 0, ((PySliceObject *)v)->start);
PyTuple_SET_ITEM(t1, 1, ((PySliceObject *)v)->stop);