From: Guido van Rossum Date: Thu, 14 Dec 2000 15:09:46 +0000 (+0000) Subject: Test for NULL returned from PyObject_NEW(). X-Git-Tag: v2.1a1~582 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=adf5410dc4df5701dd91bd71740419df61f227c7;p=python Test for NULL returned from PyObject_NEW(). --- diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 50e042afa8..bb94e42311 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;