closes bpo-34493: Objects/genobject.c: Add missing NULL check to compute_cr_origin() (GH-8911)

This commit is contained in:
Alexey Izbyshev 2018-08-25 10:15:23 +03:00 committed by Benjamin Peterson
parent 416cbce22d
commit 8fdd331bbf
1 changed files with 3 additions and 0 deletions

View File

@ -1128,6 +1128,9 @@ compute_cr_origin(int origin_depth)
/* Now collect them */ /* Now collect them */
PyObject *cr_origin = PyTuple_New(frame_count); PyObject *cr_origin = PyTuple_New(frame_count);
if (cr_origin == NULL) {
return NULL;
}
frame = PyEval_GetFrame(); frame = PyEval_GetFrame();
for (int i = 0; i < frame_count; ++i) { for (int i = 0; i < frame_count; ++i) {
PyObject *frameinfo = Py_BuildValue( PyObject *frameinfo = Py_BuildValue(