From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:38:25 +0000 (-0700) Subject: [3.12] gh-110241: Add missing error check to `record_eval` in `_testinternalcapi... X-Git-Tag: v3.12.1~397 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=892b1942a70cf2eb68a7582c7a9f3f91a3aeda1d;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-110241: Add missing error check to `record_eval` in `_testinternalcapi` (GH-110242) (#110244) gh-110241: Add missing error check to `record_eval` in `_testinternalcapi` (GH-110242) (cherry picked from commit 4596c76d1a7650fd4650c814dc1d40d664cd8fb4) Co-authored-by: Nikita Sobolev --- diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index 4e063a861529..22d156725f54 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -683,7 +683,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); }