Test for NULL returned from PyObject_NEW().
This commit is contained in:
parent
9e8f4ea0aa
commit
adf5410dc4
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue