commit | 2963fe07119c0dfa0d7fc42508912272c0100342 | [log] [tgz] |
---|---|---|
author | Benjamin Peterson <benjamin@python.org> | Mon Oct 17 13:09:27 2011 -0400 |
committer | Benjamin Peterson <benjamin@python.org> | Mon Oct 17 13:09:27 2011 -0400 |
tree | 24474312eeccea6b16604d690808058fe328368a | |
parent | 53e4a9a763aa137140dce2cb256c4a4fb923eacd [diff] [blame] |
plug possible refleak (closes #13199)
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 51c53a8..d7b97c9 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c
@@ -320,9 +320,13 @@ } t1 = PyTuple_New(3); - t2 = PyTuple_New(3); - if (t1 == NULL || t2 == NULL) + if (t1 == NULL) return NULL; + t2 = PyTuple_New(3); + if (t2 == NULL) { + Py_DECREF(t1); + return NULL; + } PyTuple_SET_ITEM(t1, 0, ((PySliceObject *)v)->start); PyTuple_SET_ITEM(t1, 1, ((PySliceObject *)v)->stop);