mirror of
https://github.com/python/cpython.git
synced 2024-11-25 10:54:51 +08:00
fix a refleak in slot_sq_length (#1162)
This commit is contained in:
parent
55fe1ae970
commit
8e1ddbd592
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user