From 9e8f4ea0aa469e5818b859836a332cfed8f81af7 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 14 Dec 2000 14:59:53 +0000 Subject: [PATCH] Test for NULL returned from PyObject_NEW(). --- Objects/rangeobject.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 1aac2dced4e..d4622eb848b 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -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;