fontconfig: Branch 'main' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 23 13:37:02 UTC 2025


 src/fcfreetype.c |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 8f169b6a9c6be7e8f1fa3480d93b33befa6bee3f
Merge: 1ce1ddd 6ecbb49
Author: Akira TAGOH <akira at tagoh.org>
Date:   Wed Jul 23 13:36:59 2025 +0000

    Merge branch 'fixCanonLeak' into 'main'
    
    Fix memory leak after path canonicalization in e42188283f0ee
    
    See merge request fontconfig/fontconfig!455

commit 6ecbb49c900c7ace4c9267f0906c3edf95dc4da5
Author: Dominik Röttsches <drott at chromium.org>
Date:   Tue Jul 22 16:43:32 2025 +0300

    Fix memory leak after path canonicalization in e42188283f0ee
    
    FcValueSave (called from FcPatternAddString) calls FcStrDup for incoming
    string objects, which means incoming strings are duplicated and owned when
    saving. This means, callers need to free passed strings.
    
    For canon_file this means, it needs to be freed not only in the erro
    case but also in the regular case, similar to foundry_.
    
    Introduced in e42188283f0ee1fb23089f16dbf95e0f3bcbacaf.

diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 47844b9..aa1c0e2 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -2080,6 +2080,8 @@ FcFreeTypeQueryFaceInternal (const FT_Face   face,
     FcCharSetDestroy (cs);
     if (foundry_)
 	free (foundry_);
+    if (canon_file)
+	free (canon_file);
 
     if (mmvar) {
 #ifdef HAVE_FT_DONE_MM_VAR


More information about the Fontconfig mailing list