Skip to content

Commit 72153b5

Browse files
miss-islingtonByteFlowing1337StanFromIreland
authored
[3.14] 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 b471b4a commit 72153b5

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
@@ -2108,6 +2108,7 @@ Xiang Zhang
21082108
Robert Xiao
21092109
Florent Xicluna
21102110
Yanbo, Xie
2111+
Ivy Xu
21112112
Kaisheng Xu
21122113
Xinhang Xu
21132114
Arnon Yaari

Objects/typeobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5114,6 +5114,7 @@ PyType_FromMetaclass(
51145114
Py_ssize_t name_buf_len = strlen(spec->name) + 1;
51155115
_ht_tpname = PyMem_Malloc(name_buf_len);
51165116
if (_ht_tpname == NULL) {
5117+
PyErr_NoMemory();
51175118
goto finally;
51185119
}
51195120
memcpy(_ht_tpname, spec->name, name_buf_len);
@@ -5397,7 +5398,7 @@ PyType_FromMetaclass(
53975398

53985399
assert(_PyType_CheckConsistency(type));
53995400

5400-
finally:
5401+
finally:
54015402
if (PyErr_Occurred()) {
54025403
Py_CLEAR(res);
54035404
}

0 commit comments

Comments
 (0)