[poppler] poppler/GlobalParams.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Mar 10 22:59:08 UTC 2023


 poppler/GlobalParams.cc |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 90da1d7b9ee200a0006bd9a103a3da10e2022e3b
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Mar 10 23:27:51 2023 +0100

    Fix memory leak in GlobalParams::findSystemFontFileForFamilyAndStyle

diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index a1fd8973..ecac32dc 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -15,7 +15,7 @@
 //
 // Copyright (C) 2005 Martin Kretzschmar <martink at gnome.org>
 // Copyright (C) 2005, 2006 Kristian Høgsberg <krh at redhat.com>
-// Copyright (C) 2005, 2007-2010, 2012, 2015, 2017-2022 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2005, 2007-2010, 2012, 2015, 2017-2023 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2005 Jonathan Blandford <jrb at redhat.com>
 // Copyright (C) 2006, 2007 Jeff Muizelaar <jeff at infidigm.net>
 // Copyright (C) 2006 Takashi Iwai <tiwai at suse.de>
@@ -1116,6 +1116,7 @@ FamilyStyleFontSearchResult GlobalParams::findSystemFontFileForFamilyAndStyle(co
     FcConfigSubstitute(nullptr, p, FcMatchPattern);
     FcDefaultSubstitute(p);
     if (p) {
+        const std::unique_ptr<FcPattern, void (*)(FcPattern *)> pDeleter(p, [](FcPattern *pattern) { FcPatternDestroy(pattern); });
         FcResult res;
         FcFontSet *fontSet = FcFontSort(nullptr, p, FcFalse, nullptr, &res);
         if (fontSet) {


More information about the poppler mailing list