mirror of
https://github.com/python/cpython.git
synced 2026-06-27 19:36:07 +00:00
gh-151763: Fix crash in _interpqueues.create on MemoryError (#152131)
This commit is contained in:
parent
3db3bba4d1
commit
a6c2d4ae3b
2 changed files with 3 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
Fix crash in :func:`!_interpqueues.create` whe :exc:`MemoryError`
|
||||
happens on queue creation.
|
||||
|
|
@ -1101,6 +1101,7 @@ queue_create(_queues *queues, Py_ssize_t maxsize,
|
|||
}
|
||||
int64_t qid = _queues_add(queues, queue);
|
||||
if (qid < 0) {
|
||||
queue->alive = 0;
|
||||
_queue_clear(queue);
|
||||
GLOBAL_FREE(queue);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue