Check for NULL return value of PyList_New (follow-up to patch #486743).

This commit is contained in:
Martin v. Löwis 2001-12-02 18:31:02 +00:00
parent d132750206
commit f8a6f241b3
1 changed files with 3 additions and 0 deletions

View File

@ -724,6 +724,9 @@ gc_get_objects(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, ":get_objects")) /* check no args */
return NULL;
result = PyList_New(0);
if (result == NULL) {
return NULL;
}
if (append_objects(result, &_PyGC_generation0) ||
append_objects(result, &generation1) ||
append_objects(result, &generation2)) {