Skip to content

GlobalParams::findSystemFontFile() calls FcFini() to prevent a memory leak

suzuki toshiya requested to merge mpsuzuki/poppler:fix-fontconfig-leak into master

It seems that GlobalParams::findSystemFontFile() can cause a memory leak. Please find attached sample PDF file file (referring Times-Roman & Helvetica, but not embedded) and a valgrind log for pdffonts.

Similar memory leak was once found in Xft (issue 295 in fontconfig, MR 5 in libXft). It was resolved by calling FcFini(). The proposed patch calls FcFini() after FcPatternDestroy(), it can fix the leak in the log file.

Merge request reports