Skip to content

Commit a6c2d4a

Browse files
authored
gh-151763: Fix crash in _interpqueues.create on MemoryError (#152131)
1 parent 3db3bba commit a6c2d4a

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
@@ -1101,6 +1101,7 @@ queue_create(_queues *queues, Py_ssize_t maxsize,
11011101
}
11021102
int64_t qid = _queues_add(queues, queue);
11031103
if (qid < 0) {
1104+
queue->alive = 0;
11041105
_queue_clear(queue);
11051106
GLOBAL_FREE(queue);
11061107
}

0 commit comments

Comments
 (0)