poppler/GlobalParams.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 90da1d7b9ee200a0006bd9a103a3da10e2022e3b Author: Albert Astals Cid <[email protected]> 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 <[email protected]> // Copyright (C) 2005, 2006 Kristian Høgsberg <[email protected]> -// Copyright (C) 2005, 2007-2010, 2012, 2015, 2017-2022 Albert Astals Cid <[email protected]> +// Copyright (C) 2005, 2007-2010, 2012, 2015, 2017-2023 Albert Astals Cid <[email protected]> // Copyright (C) 2005 Jonathan Blandford <[email protected]> // Copyright (C) 2006, 2007 Jeff Muizelaar <[email protected]> // Copyright (C) 2006 Takashi Iwai <[email protected]> @@ -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) {
