Skip to content

Commit 892b194

Browse files
[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 4596c76) Co-authored-by: Nikita Sobolev <[email protected]>
1 parent 74d0b60 commit 892b194

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Modules/_testinternalcapi.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,11 @@ record_eval(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc)
683683
assert(module != NULL);
684684
module_state *state = get_module_state(module);
685685
Py_DECREF(module);
686-
PyList_Append(state->record_list, ((PyFunctionObject *)f->f_funcobj)->func_name);
686+
int res = PyList_Append(state->record_list,
687+
((PyFunctionObject *)f->f_funcobj)->func_name);
688+
if (res < 0) {
689+
return NULL;
690+
}
687691
}
688692
return _PyEval_EvalFrameDefault(tstate, f, exc);
689693
}

0 commit comments

Comments
 (0)