FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.15] gh-151126: Add missing `PyErr_NoMemory()` in `type_from_slots_or_spec` (GH-151582) by miss-islington · Pull Request #152016 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) No extension  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions Misc/ACKS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2144,6 +2144,7 @@ Xiang Zhang
Robert Xiao
Florent Xicluna
Yanbo, Xie
Ivy Xu
Kaisheng Xu
Xinhang Xu
Arnon Yaari
Expand Down
3 changes: 2 additions & 1 deletion Objects/typeobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
Loading

Back | FazBrowse Home | New Git URL