Commit adf5410d authored by Guido van Rossum's avatar Guido van Rossum

Test for NULL returned from PyObject_NEW().

parent 9e8f4ea0
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment