summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2023-10-02 21:19:32 (GMT)
committerGitHub <noreply@github.com>2023-10-02 21:19:32 (GMT)
commit4596c76d1a7650fd4650c814dc1d40d664cd8fb4 (patch)
treecc9a5b51d96943e172d9f431a28e9386eacbd83b
parenta8f5dab58daca9f01ec3c6f8c85e53329251b05d (diff)
downloadcpython-4596c76d1a7650fd4650c814dc1d40d664cd8fb4.zip
cpython-4596c76d1a7650fd4650c814dc1d40d664cd8fb4.tar.gz
cpython-4596c76d1a7650fd4650c814dc1d40d664cd8fb4.tar.bz2
gh-110241: Add missing error check to `record_eval` in `_testinternalcapi` (#110242)
-rw-r--r--Modules/_testinternalcapi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c
index c6b80ff..05bac09 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);
}