Skip to content

Commit 00b8dab

Browse files
[3.14] gh-151763: Fix crash in _interpqueues.create on MemoryError (GH-152131) (#152159)
gh-151763: Fix crash in `_interpqueues.create` on `MemoryError` (GH-152131) (cherry picked from commit a6c2d4a) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent 6e61e3c commit 00b8dab

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix crash in :func:`!_interpqueues.create` whe :exc:`MemoryError`
2+
happens on queue creation.

Modules/_interpqueuesmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,7 @@ queue_create(_queues *queues, Py_ssize_t maxsize,
10961096
}
10971097
int64_t qid = _queues_add(queues, queue);
10981098
if (qid < 0) {
1099+
queue->alive = 0;
10991100
_queue_clear(queue);
11001101
GLOBAL_FREE(queue);
11011102
}

0 commit comments

Comments
 (0)