]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-110241: Add missing error check to `record_eval` in `_testinternalcapi...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 2 Oct 2023 21:38:25 +0000 (14:38 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Oct 2023 21:38:25 +0000 (21:38 +0000)
gh-110241: Add missing error check to `record_eval` in `_testinternalcapi` (GH-110242)
(cherry picked from commit 4596c76d1a7650fd4650c814dc1d40d664cd8fb4)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Modules/_testinternalcapi.c

index 4e063a8615293136770fdb35f562fb0cbba8e09a..22d156725f545c0e4d82b0f060e8fd2ec776fcc1 100644 (file)
@@ -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);
 }