Commit 26111623 authored by Guido van Rossum's avatar Guido van Rossum

slot_sq_length(): squash a leak.

parent 73921b0e
...@@ -2729,10 +2729,13 @@ slot_sq_length(PyObject *self) ...@@ -2729,10 +2729,13 @@ slot_sq_length(PyObject *self)
{ {
static PyObject *len_str; static PyObject *len_str;
PyObject *res = call_method(self, "__len__", &len_str, "()"); PyObject *res = call_method(self, "__len__", &len_str, "()");
int len;
if (res == NULL) if (res == NULL)
return -1; return -1;
return (int)PyInt_AsLong(res); len = (int)PyInt_AsLong(res);
Py_DECREF(res);
return len;
} }
SLOT1(slot_sq_concat, "__add__", PyObject *, "O") SLOT1(slot_sq_concat, "__add__", PyObject *, "O")
......
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