]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] 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:15:00 +0000 (17:15 +0200)
committerGitHub <noreply@github.com>
Tue, 23 Jun 2026 15:15:00 +0000 (15:15 +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 38817b1698c09a9797d6f5dedd6309b35f28def7..5b5df7ae11f2dfd66b25d7ea375f22d61159c02b 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -2144,6 +2144,7 @@ Xiang Zhang
 Robert Xiao
 Florent Xicluna
 Yanbo, Xie
+Ivy Xu
 Kaisheng Xu
 Xinhang Xu
 Arnon Yaari
index 12821b134d970962c0a1850dbd440cca1f261b20..969ae450013a311243260bade08f431b0d5a887a 100644 (file)
@@ -5488,6 +5488,7 @@ type_from_slots_or_spec(
     Py_ssize_t name_buf_len = strlen(it.name) + 1;
     _ht_tpname = PyMem_Malloc(name_buf_len);
     if (_ht_tpname == NULL) {
+        PyErr_NoMemory();
         goto finally;
     }
     memcpy(_ht_tpname, it.name, name_buf_len);
@@ -5774,7 +5775,7 @@ type_from_slots_or_spec(
     ((PyObject*)type)->ob_flags |= _Py_TYPE_REVEALED_FLAG;
 #endif
 
- finally:
+finally:
     if (PyErr_Occurred()) {
         Py_CLEAR(res);
     }