mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
config: silence valgrind-detected leak in config_font_parse()
This commit is contained in:
parent
aa579acd6e
commit
693aefa96a
1 changed files with 3 additions and 1 deletions
4
config.c
4
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue