summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-12-02 18:31:02 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-12-02 18:31:02 (GMT)
commitf8a6f241b33310dee28e8f83d52a79f6ea84ceb9 (patch)
treef6bc4a5704c67d695f4303233e2dfd6bb433c680 /Modules
parentd132750206afe3d634f46d48c127f8f673aaaae3 (diff)
downloadcpython-f8a6f241b33310dee28e8f83d52a79f6ea84ceb9.zip
cpython-f8a6f241b33310dee28e8f83d52a79f6ea84ceb9.tar.gz
cpython-f8a6f241b33310dee28e8f83d52a79f6ea84ceb9.tar.bz2
Check for NULL return value of PyList_New (follow-up to patch #486743).
Diffstat (limited to 'Modules')
-rw-r--r--Modules/gcmodule.c3
1 files changed, 3 insertions, 0 deletions
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)) {