summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)) {