diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-10-17 13:09:27 -0400 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-10-17 13:09:27 -0400 |
commit | 2963fe07119c0dfa0d7fc42508912272c0100342 (patch) | |
tree | 24474312eeccea6b16604d690808058fe328368a /Objects/sliceobject.c | |
parent | normalize whitespace in Lib/distutils/msvc9compiler.py (diff) | |
download | cpython-2963fe07119c0dfa0d7fc42508912272c0100342.tar.gz cpython-2963fe07119c0dfa0d7fc42508912272c0100342.tar.bz2 cpython-2963fe07119c0dfa0d7fc42508912272c0100342.zip |
plug possible refleak (closes #13199)
Diffstat (limited to 'Objects/sliceobject.c')
-rw-r--r-- | Objects/sliceobject.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 51c53a8a11c..d7b97c9699a 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -320,9 +320,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); |