Skip to content

Commit 4596c76

Browse files
authored
gh-110241: Add missing error check to record_eval in _testinternalcapi (#110242)
1 parent a8f5dab commit 4596c76

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Modules/_testinternalcapi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,11 @@ record_eval(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc)
675675
assert(module != NULL);
676676
module_state *state = get_module_state(module);
677677
Py_DECREF(module);
678-
PyList_Append(state->record_list, ((PyFunctionObject *)f->f_funcobj)->func_name);
678+
int res = PyList_Append(state->record_list,
679+
((PyFunctionObject *)f->f_funcobj)->func_name);
680+
if (res < 0) {
681+
return NULL;
682+
}
679683
}
680684
return _PyEval_EvalFrameDefault(tstate, f, exc);
681685
}

0 commit comments

Comments
 (0)