]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110241: Add missing error check to `record_eval` in `_testinternalcapi` (#110242)
authorNikita Sobolev <mail@sobolevn.me>
Mon, 2 Oct 2023 21:19:32 +0000 (00:19 +0300)
committerGitHub <noreply@github.com>
Mon, 2 Oct 2023 21:19:32 +0000 (21:19 +0000)
Modules/_testinternalcapi.c

index c6b80fffdec16d893ea8dee7de27dd4d9765e7a7..05bac0936b155d68f15f872b5c2cec0aacfac86f 100644 (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);
 }