mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix memory leak in ICU sort_key
This commit is contained in:
parent
a9983208d7
commit
0aab245a1d
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user