From 6b8c070aa2a30a15f3d3187fc35af0cfe662d354 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 23 Sep 2017 20:02:45 +0200 Subject: cleanup: do not overwrite/free original font description (likely unproblematic but better be safe than sorry...) --- src/libnrtype/FontFactory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libnrtype') diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index 40e5d4ba1..3b7b5b9b4 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -685,10 +685,10 @@ font_instance *font_factory::Face(PangoFontDescription *descr, bool canFail) // no match if ( canFail ) { PANGO_DEBUG("falling back to 'sans-serif'\n"); - descr = pango_font_description_new(); - pango_font_description_set_family(descr,"sans-serif"); - res = Face(descr,false); - pango_font_description_free(descr); + PangoFontDescription *new_descr = pango_font_description_new(); + pango_font_description_set_family(new_descr, "sans-serif"); + res = Face(new_descr, false); + pango_font_description_free(new_descr); } else { g_critical("Could not load any face for font '%s'.", pango_font_description_to_string(descr)); } -- cgit v1.2.3