mirror of https://github.com/python/cpython.git
gh-133891: Add missing error check to `SET_COUNT` macro in `_testinternalcapi.c` (#133892)
This commit is contained in:
parent
3704171415
commit
cebae977a6
|
@ -1045,6 +1045,9 @@ get_code_var_counts(PyObject *self, PyObject *_args, PyObject *_kwargs)
|
||||||
#define SET_COUNT(DICT, STRUCT, NAME) \
|
#define SET_COUNT(DICT, STRUCT, NAME) \
|
||||||
do { \
|
do { \
|
||||||
PyObject *count = PyLong_FromLong(STRUCT.NAME); \
|
PyObject *count = PyLong_FromLong(STRUCT.NAME); \
|
||||||
|
if (count == NULL) { \
|
||||||
|
goto error; \
|
||||||
|
} \
|
||||||
int res = PyDict_SetItemString(DICT, #NAME, count); \
|
int res = PyDict_SetItemString(DICT, #NAME, count); \
|
||||||
Py_DECREF(count); \
|
Py_DECREF(count); \
|
||||||
if (res < 0) { \
|
if (res < 0) { \
|
||||||
|
|
Loading…
Reference in New Issue