mirror of
https://github.com/python/cpython.git
synced 2024-11-26 19:34:19 +08:00
slot_sq_length(): squash a leak.
This commit is contained in:
parent
73921b0eec
commit
2611162345
@ -2729,10 +2729,13 @@ slot_sq_length(PyObject *self)
|
||||
{
|
||||
static PyObject *len_str;
|
||||
PyObject *res = call_method(self, "__len__", &len_str, "()");
|
||||
int len;
|
||||
|
||||
if (res == NULL)
|
||||
return -1;
|
||||
return (int)PyInt_AsLong(res);
|
||||
len = (int)PyInt_AsLong(res);
|
||||
Py_DECREF(res);
|
||||
return len;
|
||||
}
|
||||
|
||||
SLOT1(slot_sq_concat, "__add__", PyObject *, "O")
|
||||
|
Loading…
Reference in New Issue
Block a user