From 8a27fe34c89ca1154891b14a91544d602e8351fa Mon Sep 17 00:00:00 2001 From: Jason Crain Date: Tue, 24 Mar 2015 02:51:47 -0500 Subject: [PATCH] cairo: Free font's data->bytes in _ft_done_face Bug #89951 --- poppler/CairoFontEngine.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/poppler/CairoFontEngine.cc b/poppler/CairoFontEngine.cc index a5a3023..7283190 100644 --- a/poppler/CairoFontEngine.cc +++ b/poppler/CairoFontEngine.cc @@ -256,12 +256,16 @@ _ft_done_face (void *closure) else _ft_open_faces = data->next; + if (data->fd != -1) { #if defined(__SUNPRO_CC) && defined(__sun) && defined(__SVR4) - munmap ((char*)data->bytes, data->size); + munmap ((char*)data->bytes, data->size); #else - munmap (data->bytes, data->size); + munmap (data->bytes, data->size); #endif - close (data->fd); + close (data->fd); + } else { + gfree (data->bytes); + } FT_Done_Face (data->face); gfree (data); -- 2.1.4