]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-151126: Add missing `PyErr_NoMemory()` in `type_from_slots_or_spec` (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 23 Jun 2026 15:14:39 +0000 (17:14 +0200)
committerGitHub <noreply@github.com>
Tue, 23 Jun 2026 15:14:39 +0000 (15:14 +0000)
(cherry picked from commit 7928a8b730b0334c9f97c2144ab00fe0d88f1e97)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Misc/ACKS
Objects/typeobject.c

index 00a4c4a8a58786c8d586a6bf631a285d4eb3b758..2f0cfb5b552b347880acca7f39b04fc5ec4d9e54 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -2108,6 +2108,7 @@ Xiang Zhang
 Robert Xiao
 Florent Xicluna
 Yanbo, Xie
+Ivy Xu
 Kaisheng Xu
 Xinhang Xu
 Arnon Yaari
index a887d724b92df04eb8580e4c707d83f0a4fdcec7..40cb8816c8342a86463d45344905f07d929e4142 100644 (file)
@@ -5114,6 +5114,7 @@ PyType_FromMetaclass(
     Py_ssize_t name_buf_len = strlen(spec->name) + 1;
     _ht_tpname = PyMem_Malloc(name_buf_len);
     if (_ht_tpname == NULL) {
+        PyErr_NoMemory();
         goto finally;
     }
     memcpy(_ht_tpname, spec->name, name_buf_len);
@@ -5397,7 +5398,7 @@ PyType_FromMetaclass(
 
     assert(_PyType_CheckConsistency(type));
 
- finally:
+finally:
     if (PyErr_Occurred()) {
         Py_CLEAR(res);
     }