Commit 305e49e1 authored by Christian Heimes's avatar Christian Heimes

Fix memory leak in endswith

CID 1040368 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable substring going out of scope leaks the storage it points to.
parent b7bb6f57
......@@ -12941,9 +12941,9 @@ unicode_endswith(PyObject *self,
return NULL;
}
result = tailmatch(self, substring, start, end, +1);
Py_DECREF(substring);
if (result == -1)
return NULL;
Py_DECREF(substring);
return PyBool_FromLong(result);
}
......
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