gh-151763: Fix crash in _interpqueues.create on MemoryError (#152131)

This commit is contained in:
sobolevn 2026-06-25 10:04:02 +03:00 committed by GitHub
parent 3db3bba4d1
commit a6c2d4ae3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1,2 @@
Fix crash in :func:`!_interpqueues.create` whe :exc:`MemoryError`
happens on queue creation.

View file

@ -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);
}