]> granicus.if.org Git - python/commitdiff
Test for NULL returned from PyObject_NEW().
authorGuido van Rossum <guido@python.org>
Thu, 14 Dec 2000 15:09:46 +0000 (15:09 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 14 Dec 2000 15:09:46 +0000 (15:09 +0000)
Objects/sliceobject.c

index 50e042afa8569d7116379e5ba00eaeee986839e3..bb94e4231165552a614f698f8181900041216526 100644 (file)
@@ -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;