diff options
-rw-r--r-- | e-util/ChangeLog | 6 | ||||
-rw-r--r-- | e-util/e-util.c | 15 |
2 files changed, 19 insertions, 2 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index d32f66f2f9..367105882e 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,9 @@ +2007-11-05 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #492692 + + * e-util.c: (e_str_case_compare): Leak fix. + 2007-11-03 Matthew Barnes <mbarnes@redhat.com> ** Remove dead files from source control. The dates below diff --git a/e-util/e-util.c b/e-util/e-util.c index 05bfdb4c0f..c27e2a60d8 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -98,14 +98,25 @@ e_str_compare (gconstpointer x, gconstpointer y) gint e_str_case_compare (gconstpointer x, gconstpointer y) { + gchar *cx, *cy; + gint res; + if (x == NULL || y == NULL) { if (x == y) return 0; else return x ? -1 : 1; } - - return g_utf8_collate (g_utf8_casefold (x, -1), g_utf8_casefold (y, -1)); + + cx = g_utf8_casefold (x, -1); + cy = g_utf8_casefold (y, -1); + + res = g_utf8_collate (cx, cy); + + g_free (cx); + g_free (cy); + + return res; } gint |