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.
This commit is contained in:
Christian Heimes 2013-06-29 20:41:06 +02:00
parent b7bb6f571b
commit 305e49e17e
1 changed files with 1 additions and 1 deletions

View File

@ -12941,9 +12941,9 @@ unicode_endswith(PyObject *self,
return NULL; return NULL;
} }
result = tailmatch(self, substring, start, end, +1); result = tailmatch(self, substring, start, end, +1);
Py_DECREF(substring);
if (result == -1) if (result == -1)
return NULL; return NULL;
Py_DECREF(substring);
return PyBool_FromLong(result); return PyBool_FromLong(result);
} }