mirror of https://github.com/python/cpython
Check for NULL return value of PyList_New (follow-up to patch #486743).
This commit is contained in:
parent
d132750206
commit
f8a6f241b3
|
@ -724,6 +724,9 @@ gc_get_objects(PyObject *self, PyObject *args)
|
||||||
if (!PyArg_ParseTuple(args, ":get_objects")) /* check no args */
|
if (!PyArg_ParseTuple(args, ":get_objects")) /* check no args */
|
||||||
return NULL;
|
return NULL;
|
||||||
result = PyList_New(0);
|
result = PyList_New(0);
|
||||||
|
if (result == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (append_objects(result, &_PyGC_generation0) ||
|
if (append_objects(result, &_PyGC_generation0) ||
|
||||||
append_objects(result, &generation1) ||
|
append_objects(result, &generation1) ||
|
||||||
append_objects(result, &generation2)) {
|
append_objects(result, &generation2)) {
|
||||||
|
|
Loading…
Reference in New Issue