aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-07-11 14:47:51 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-07-11 14:47:51 +0000
commit693aefa96a74b0e4b9117a0c4ffe8c95b35b0c8b (patch)
treef9f3748a37a498c6049cde9edf39544234118d36 /config.c
parentissue template: compositor version -> compositor name and version (diff)
config: silence valgrind-detected leak in config_font_parse()
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/config.c b/config.c
index d8f1c0ed..77dc3a73 100644
--- a/config.c
+++ b/config.c
@@ -3956,9 +3956,10 @@ config_font_parse(const char *pattern, struct config_font *font)
* both "size" and "pixelsize" being set, and we don't know
* which one takes priority.
*/
+ FcConfig *fc_conf = FcConfigCreate();
FcPattern *pat_copy = FcPatternDuplicate(pat);
if (pat_copy == NULL ||
- !FcConfigSubstitute(NULL, pat_copy, FcMatchPattern))
+ !FcConfigSubstitute(fc_conf, pat_copy, FcMatchPattern))
{
LOG_WARN("%s: failed to do config substitution", pattern);
} else {
@@ -3967,6 +3968,7 @@ config_font_parse(const char *pattern, struct config_font *font)
}
FcPatternDestroy(pat_copy);
+ FcConfigDestroy(fc_conf);
if (have_pt_size != FcResultMatch && have_px_size != FcResultMatch)
pt_size = 8.0;