From: Alexey Izbyshev Date: Sat, 25 Aug 2018 07:15:23 +0000 (+0300) Subject: closes bpo-34493: Objects/genobject.c: Add missing NULL check to compute_cr_origin... X-Git-Tag: v3.8.0a1~1162 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fdd331bbf7e60dd81c02c7077f44c7939e2a05d;p=python closes bpo-34493: Objects/genobject.c: Add missing NULL check to compute_cr_origin() (GH-8911) --- diff --git a/Objects/genobject.c b/Objects/genobject.c index e55cfd21c6..453b100330 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1128,6 +1128,9 @@ compute_cr_origin(int origin_depth) /* Now collect them */ PyObject *cr_origin = PyTuple_New(frame_count); + if (cr_origin == NULL) { + return NULL; + } frame = PyEval_GetFrame(); for (int i = 0; i < frame_count; ++i) { PyObject *frameinfo = Py_BuildValue(