Skip to content

Commit 0f0969e

Browse files
sobolevnmiss-islington
authored andcommitted
gh-152156: Fix a crash in interpeters.create under limited memory conditions (GH-152163)
(cherry picked from commit 3ad66bf) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent d740050 commit 0f0969e

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:`concurrent.interpreters.create` under limited
2+
memory conditions.

Modules/_interpchannelsmodule.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2919,10 +2919,8 @@ channelsmod_create(PyObject *self, PyObject *args, PyObject *kwds)
29192919
(channelid **)&cidobj);
29202920
if (handle_channel_error(err, self, cid)) {
29212921
assert(cidobj == NULL);
2922-
err = channel_destroy(&_globals.channels, cid);
2923-
if (handle_channel_error(err, self, cid)) {
2924-
// XXX issue a warning?
2925-
}
2922+
assert(PyErr_Occurred());
2923+
(void)channel_destroy(&_globals.channels, cid);
29262924
return NULL;
29272925
}
29282926
assert(cidobj != NULL);

0 commit comments

Comments
 (0)