Skip to content

Commit cebae97

Browse files
authored
gh-133891: Add missing error check to SET_COUNT macro in _testinternalcapi.c (#133892)
1 parent 3704171 commit cebae97

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Modules/_testinternalcapi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,9 @@ get_code_var_counts(PyObject *self, PyObject *_args, PyObject *_kwargs)
10451045
#define SET_COUNT(DICT, STRUCT, NAME) \
10461046
do { \
10471047
PyObject *count = PyLong_FromLong(STRUCT.NAME); \
1048+
if (count == NULL) { \
1049+
goto error; \
1050+
} \
10481051
int res = PyDict_SetItemString(DICT, #NAME, count); \
10491052
Py_DECREF(count); \
10501053
if (res < 0) { \

0 commit comments

Comments
 (0)