mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
slot_sq_length(): squash a leak.
This commit is contained in:
parent
73921b0eec
commit
2611162345
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue