]> granicus.if.org Git - python/commitdiff
Test for NULL returned from PyObject_NEW().
authorGuido van Rossum <guido@python.org>
Thu, 14 Dec 2000 14:59:53 +0000 (14:59 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 14 Dec 2000 14:59:53 +0000 (14:59 +0000)
Objects/rangeobject.c

index 1aac2dced4e0bc8438e2a2680eec630d9343db00..d4622eb848bb70426bf4a487f48076596e74c0c6 100644 (file)
@@ -19,6 +19,9 @@ PyRange_New(long start, long len, long step, int reps)
 {
        rangeobject *obj = PyObject_NEW(rangeobject, &PyRange_Type);
 
+       if (obj == NULL)
+               return NULL;
+
        obj->start = start;
        obj->len   = len;
        obj->step  = step;