diff options
author | Guido van Rossum <guido@python.org> | 2000-12-14 14:59:53 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-12-14 14:59:53 (GMT) |
commit | 9e8f4ea0aa469e5818b859836a332cfed8f81af7 (patch) | |
tree | d5310f56cd6d7911a8d1cc5bfc234a1e998db5c7 /Objects | |
parent | f0b315478ba086aa2c9b3f9c551a28e54356f583 (diff) | |
download | cpython-9e8f4ea0aa469e5818b859836a332cfed8f81af7.zip cpython-9e8f4ea0aa469e5818b859836a332cfed8f81af7.tar.gz cpython-9e8f4ea0aa469e5818b859836a332cfed8f81af7.tar.bz2 |
Test for NULL returned from PyObject_NEW().
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/rangeobject.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 @@ 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; |