Skip to content

Commit a8708f7

Browse files
[3.14] gh-133891: Add missing error check to SET_COUNT macro in _testinternalcapi.c (GH-133892) (#134988)
gh-133891: Add missing error check to `SET_COUNT` macro in `_testinternalcapi.c` (GH-133892) (cherry picked from commit cebae97) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent 890607f commit a8708f7

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)