Test for NULL returned from PyObject_NEW().
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index 1aac2dc..d4622eb 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -19,6 +19,9 @@
 {
 	rangeobject *obj = PyObject_NEW(rangeobject, &PyRange_Type);
 
+	if (obj == NULL)
+		return NULL;
+
 	obj->start = start;
 	obj->len   = len;
 	obj->step  = step;