mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-133891: Add missing error check to SET_COUNT
macro in _testinternalcapi.c
(#133892)
This commit is contained in:
parent
3704171415
commit
cebae977a6
1 changed files with 3 additions and 0 deletions
|
@ -1045,6 +1045,9 @@ get_code_var_counts(PyObject *self, PyObject *_args, PyObject *_kwargs)
|
|||
#define SET_COUNT(DICT, STRUCT, NAME) \
|
||||
do { \
|
||||
PyObject *count = PyLong_FromLong(STRUCT.NAME); \
|
||||
if (count == NULL) { \
|
||||
goto error; \
|
||||
} \
|
||||
int res = PyDict_SetItemString(DICT, #NAME, count); \
|
||||
Py_DECREF(count); \
|
||||
if (res < 0) { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue