gh-110241: Add missing error check to record_eval in _testinternalcapi (#110242)

This commit is contained in:
Nikita Sobolev 2023-10-03 00:19:32 +03:00 committed by GitHub
parent a8f5dab58d
commit 4596c76d1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -675,7 +675,11 @@ record_eval(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc)
assert(module != NULL);
module_state *state = get_module_state(module);
Py_DECREF(module);
PyList_Append(state->record_list, ((PyFunctionObject *)f->f_funcobj)->func_name);
int res = PyList_Append(state->record_list,
((PyFunctionObject *)f->f_funcobj)->func_name);
if (res < 0) {
return NULL;
}
}
return _PyEval_EvalFrameDefault(tstate, f, exc);
}