fix a refleak in slot_sq_length (#1162)

This commit is contained in:
Xiang Zhang 2017-04-17 00:54:21 +08:00 committed by GitHub
parent 55fe1ae970
commit 8e1ddbd592

View file

@ -5931,6 +5931,7 @@ slot_sq_length(PyObject *self)
assert(PyLong_Check(res));
if (Py_SIZE(res) < 0) {
Py_DECREF(res);
PyErr_SetString(PyExc_ValueError,
"__len__() should return >= 0");
return -1;