From f8a6f241b33310dee28e8f83d52a79f6ea84ceb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sun, 2 Dec 2001 18:31:02 +0000 Subject: Check for NULL return value of PyList_New (follow-up to patch #486743). --- Modules/gcmodule.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 7f8d71a..b607d38 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -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)) { -- cgit v0.12