match.c: fix g_utf8_casefold() memory leak

Reported-by: @jlindgren90
This commit is contained in:
Johan Malm 2023-05-06 11:30:45 +01:00 committed by Johan Malm
parent d609c9e3f9
commit bdd3849138

View file

@ -6,6 +6,11 @@
bool
match_glob(const gchar *pattern, const gchar *string)
{
return g_pattern_match_simple(g_utf8_casefold(pattern, -1), g_utf8_casefold(string, -1));
gchar *p = g_utf8_casefold(pattern, -1);
gchar *s = g_utf8_casefold(string, -1);
bool ret = g_pattern_match_simple(p, s);
g_free(p);
g_free(s);
return ret;
}