]> git.mdlowis.com Git - proto/labwc.git/commitdiff
match.c: fix g_utf8_casefold() memory leak
authorJohan Malm <jgm323@gmail.com>
Sat, 6 May 2023 10:30:45 +0000 (11:30 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 6 May 2023 11:08:31 +0000 (12:08 +0100)
Reported-by: @jlindgren90
src/common/match.c

index eb975f637b3bcb921e8dacc0eb006ec49b7c6f15..5b9f46c06584bbd39d7c34dd799658cbed654624 100644 (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;
 }