mirror of
https://github.com/python/cpython.git
synced 2026-07-05 01:11:21 -04:00
gh-152951 - Fix double DECREF when newblock fails during deque.extend calls (#152961)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
:class:`collections.deque` prevent rare crash when calling ``extend`` under
|
||||
high memory pressure conditions.
|
||||
@@ -512,7 +512,6 @@ deque_extend_impl(dequeobject *deque, PyObject *iterable)
|
||||
iternext = *Py_TYPE(it)->tp_iternext;
|
||||
while ((item = iternext(it)) != NULL) {
|
||||
if (deque_append_lock_held(deque, item, maxlen) == -1) {
|
||||
Py_DECREF(item);
|
||||
Py_DECREF(it);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user