mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-17 05:33:52 -04: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
|
* both "size" and "pixelsize" being set, and we don't know
|
||||||
* which one takes priority.
|
* which one takes priority.
|
||||||
*/
|
*/
|
||||||
|
FcConfig *fc_conf = FcConfigCreate();
|
||||||
FcPattern *pat_copy = FcPatternDuplicate(pat);
|
FcPattern *pat_copy = FcPatternDuplicate(pat);
|
||||||
if (pat_copy == NULL ||
|
if (pat_copy == NULL ||
|
||||||
!FcConfigSubstitute(NULL, pat_copy, FcMatchPattern))
|
!FcConfigSubstitute(fc_conf, pat_copy, FcMatchPattern))
|
||||||
{
|
{
|
||||||
LOG_WARN("%s: failed to do config substitution", pattern);
|
LOG_WARN("%s: failed to do config substitution", pattern);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -3967,6 +3968,7 @@ config_font_parse(const char *pattern, struct config_font *font)
|
||||||
}
|
}
|
||||||
|
|
||||||
FcPatternDestroy(pat_copy);
|
FcPatternDestroy(pat_copy);
|
||||||
|
FcConfigDestroy(fc_conf);
|
||||||
|
|
||||||
if (have_pt_size != FcResultMatch && have_px_size != FcResultMatch)
|
if (have_pt_size != FcResultMatch && have_px_size != FcResultMatch)
|
||||||
pt_size = 8.0;
|
pt_size = 8.0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue