diff options
author | Guido van Rossum <guido@python.org> | 2000-12-14 15:09:46 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-12-14 15:09:46 (GMT) |
commit | adf5410dc4df5701dd91bd71740419df61f227c7 (patch) | |
tree | afde6cdc326b27a5370d6c711d11ce8485bef544 /Objects | |
parent | 9e8f4ea0aa469e5818b859836a332cfed8f81af7 (diff) | |
download | cpython-adf5410dc4df5701dd91bd71740419df61f227c7.zip cpython-adf5410dc4df5701dd91bd71740419df61f227c7.tar.gz cpython-adf5410dc4df5701dd91bd71740419df61f227c7.tar.bz2 |
Test for NULL returned from PyObject_NEW().
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/sliceobject.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 50e042a..bb94e42 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -55,6 +55,9 @@ PySlice_New(PyObject *start, PyObject *stop, PyObject *step) { PySliceObject *obj = PyObject_NEW(PySliceObject, &PySlice_Type); + if (obj == NULL) + return NULL; + if (step == NULL) step = Py_None; Py_INCREF(step); if (start == NULL) start = Py_None; |