Skip to content

Commit 2ff445b

Browse files
miss-islingtonByteFlowing1337StanFromIreland
authored
[3.15] gh-151126: Add missing PyErr_NoMemory() in type_from_slots_or_spec (GH-151582) (#152016)
(cherry picked from commit 7928a8b) Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com> Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 7b765a4 commit 2ff445b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,7 @@ Xiang Zhang
21442144
Robert Xiao
21452145
Florent Xicluna
21462146
Yanbo, Xie
2147+
Ivy Xu
21472148
Kaisheng Xu
21482149
Xinhang Xu
21492150
Arnon Yaari

Objects/typeobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5488,6 +5488,7 @@ type_from_slots_or_spec(
54885488
Py_ssize_t name_buf_len = strlen(it.name) + 1;
54895489
_ht_tpname = PyMem_Malloc(name_buf_len);
54905490
if (_ht_tpname == NULL) {
5491+
PyErr_NoMemory();
54915492
goto finally;
54925493
}
54935494
memcpy(_ht_tpname, it.name, name_buf_len);
@@ -5774,7 +5775,7 @@ type_from_slots_or_spec(
57745775
((PyObject*)type)->ob_flags |= _Py_TYPE_REVEALED_FLAG;
57755776
#endif
57765777

5777-
finally:
5778+
finally:
57785779
if (PyErr_Occurred()) {
57795780
Py_CLEAR(res);
57805781
}

0 commit comments

Comments
 (0)