]> granicus.if.org Git - python/commitdiff
Check for NULL return value of PyList_New (follow-up to patch #486743).
authorMartin v. Löwis <martin@v.loewis.de>
Sun, 2 Dec 2001 18:31:02 +0000 (18:31 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sun, 2 Dec 2001 18:31:02 +0000 (18:31 +0000)
Modules/gcmodule.c

index 7f8d71a3e6bea997a215347a29574a4d8c4e26f4..b607d38b406311f273e0c96a383e74d1fb1250ab 100644 (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)) {