gh-133891: Add missing error check to `SET_COUNT` macro in `_testinternalcapi.c` (#133892)

This commit is contained in:
sobolevn 2025-06-01 00:33:02 +03:00 committed by GitHub
parent 3704171415
commit cebae977a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -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) { \