fontconfig: Branch 'main'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 src/fcxml.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit ec3e747d2fe874f265464bb83a5705df39e2003f
Author: Ben Wagner <bungeman@xxxxxxxxxxxx>
Date:   Thu Mar 30 14:23:27 2023 -0400

    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] https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/fcada522913e5e07efa6367eff87ace9f06d24c8
    [1] https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/cd51cb241aad7b362b793200ca7d42595c14f52b

diff --git a/src/fcxml.c b/src/fcxml.c
index c700f64..9fe0674 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -3689,7 +3689,10 @@ bail0:
     if (realfilename)
 	FcStrFree (realfilename);
     if (!complain)
+    {
+	FcStrBufDestroy (&reason);
 	return FcTrue;
+    }
     if (!ret && complain_again)
     {
 	if (name)



[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux