Fix memory leak in ICU sort_key

This commit is contained in:
Kovid Goyal 2010-12-04 09:12:38 -07:00
parent a9983208d7
commit 0aab245a1d

View File

@ -105,6 +105,7 @@ icu_Collator_sort_key(icu_Collator *self, PyObject *args, PyObject *kwargs) {
if (buf == NULL) return PyErr_NoMemory();
u_strFromUTF8(buf, sz*4 + 1, &key_size, input, sz, &status);
PyMem_Free(input);
if (U_SUCCESS(status)) {
key_size = ucol_getSortKey(self->collator, buf, -1, NULL, 0);