From: Martin v. Löwis Date: Sun, 2 Dec 2001 18:31:02 +0000 (+0000) Subject: Check for NULL return value of PyList_New (follow-up to patch #486743). X-Git-Tag: v2.2.1c1~613 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8a6f241b33310dee28e8f83d52a79f6ea84ceb9;p=python Check for NULL return value of PyList_New (follow-up to patch #486743). --- diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 7f8d71a3e6..b607d38b40 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)) {