Fix uninitialized memory access when failing memory allocation.

FamilyTableInit() is called after allocating memory.
but FamilyTableClear() may be called when the allocation is failed.

Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/374

Reported by Andreas Falkenhahn
This commit is contained in:
Akira TAGOH 2023-07-27 16:11:07 +09:00
parent f07d7c67e4
commit 2fb3419a92
1 changed files with 1 additions and 1 deletions

View File

@ -2275,8 +2275,8 @@ FcConfigSubstituteWithPat (FcConfig *config,
printf ("FcConfigSubstitute done");
FcPatternPrint (p);
}
bail1:
FamilyTableClear (&data);
bail1:
if (elt)
free (elt);
if (value)