From bdd384913810010bf2558469087fe8132f722e75 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sat, 6 May 2023 11:30:45 +0100 Subject: [PATCH] match.c: fix g_utf8_casefold() memory leak Reported-by: @jlindgren90 --- src/common/match.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/match.c b/src/common/match.c index eb975f63..5b9f46c0 100644 --- a/src/common/match.c +++ b/src/common/match.c @@ -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; } -- 2.52.0