Skip to content

Commit abf5016

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

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
@@ -2079,6 +2079,7 @@ Xiang Zhang
20792079
Robert Xiao
20802080
Florent Xicluna
20812081
Yanbo, Xie
2082+
Ivy Xu
20822083
Kaisheng Xu
20832084
Xinhang Xu
20842085
Arnon Yaari

Objects/typeobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4581,6 +4581,7 @@ _PyType_FromMetaclass_impl(
45814581
Py_ssize_t name_buf_len = strlen(spec->name) + 1;
45824582
_ht_tpname = PyMem_Malloc(name_buf_len);
45834583
if (_ht_tpname == NULL) {
4584+
PyErr_NoMemory();
45844585
goto finally;
45854586
}
45864587
memcpy(_ht_tpname, spec->name, name_buf_len);
@@ -4862,7 +4863,7 @@ _PyType_FromMetaclass_impl(
48624863

48634864
assert(_PyType_CheckConsistency(type));
48644865

4865-
finally:
4866+
finally:
48664867
if (PyErr_Occurred()) {
48674868
Py_CLEAR(res);
48684869
}

0 commit comments

Comments
 (0)