Fix leak of `reason` in _FcConfigParse when not complaining

In "Do not return FcFalse from FcConfigParseAndLoad*() if complain is
set to false" [0], _FcConfigParse was updated to return FcTrue early if
it was instructed not to complain on errors. In "Take effect sysroot
functionality to the default config file" [1] the error messages were
factored into a `reason` which was allocated. Be sure to free this
`reason` in the case of returning FcTrue early.

Discovered with a leak checker while attempting to configure in
interesting ways.

[0] fcada52291
[1] cd51cb241a
This commit is contained in:
Ben Wagner 2023-03-30 14:23:27 -04:00
parent c2666a6d9a
commit ec3e747d2f
1 changed files with 3 additions and 0 deletions

View File

@ -3689,7 +3689,10 @@ bail0:
if (realfilename)
FcStrFree (realfilename);
if (!complain)
{
FcStrBufDestroy (&reason);
return FcTrue;
}
if (!ret && complain_again)
{
if (name)