Skip to content

Commit 28a6abf

Browse files
committed
gh-152156: Fix a crash in interpeters.create under limited memory conditions
1 parent 3db3bba commit 28a6abf

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a possible crash in :func:`concurrect.interpreters.create` under limited
2+
memory conditions.

Modules/_interpchannelsmodule.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,10 +2951,8 @@ channelsmod_create(PyObject *self, PyObject *args, PyObject *kwds)
29512951
&cidobj);
29522952
if (handle_channel_error(err, self, cid)) {
29532953
assert(cidobj == NULL);
2954-
err = channel_destroy(&_globals.channels, cid);
2955-
if (handle_channel_error(err, self, cid)) {
2956-
// XXX issue a warning?
2957-
}
2954+
assert(PyErr_Occurred());
2955+
(void)channel_destroy(&_globals.channels, cid);
29582956
return NULL;
29592957
}
29602958
assert(cidobj != NULL);

0 commit comments

Comments
 (0)