Commit 2963fe07 authored by Benjamin Peterson's avatar Benjamin Peterson

plug possible refleak (closes #13199)

parent 53e4a9a7
......@@ -320,9 +320,13 @@ slice_richcompare(PyObject *v, PyObject *w, int op)
}
t1 = PyTuple_New(3);
if (t1 == NULL)
return NULL;
t2 = PyTuple_New(3);
if (t1 == NULL || t2 == NULL)
if (t2 == NULL) {
Py_DECREF(t1);
return NULL;
}
PyTuple_SET_ITEM(t1, 0, ((PySliceObject *)v)->start);
PyTuple_SET_ITEM(t1, 1, ((PySliceObject *)v)->stop);
......
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