From: Nikita Sobolev Date: Mon, 2 Oct 2023 21:19:32 +0000 (+0300) Subject: gh-110241: Add missing error check to `record_eval` in `_testinternalcapi` (#110242) X-Git-Tag: v3.13.0a1~175 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4596c76d1a7650fd4650c814dc1d40d664cd8fb4;p=thirdparty%2FPython%2Fcpython.git gh-110241: Add missing error check to `record_eval` in `_testinternalcapi` (#110242) --- diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index c6b80fffdec1..05bac0936b15 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -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); }