summaryrefslogtreecommitdiff
path: root/pango/pangoft2-fontmap.c
diff options
context:
space:
mode:
authorAlex Larsson <alexl@redhat.com>2002-03-26 15:32:37 +0000
committerAlexander Larsson <alexl@src.gnome.org>2002-03-26 15:32:37 +0000
commit9d36c1dc2da9797cf08a915008c49570ff38578c (patch)
treef687bd0750cdb72ee04a3a7fc5787b00e06d5cea /pango/pangoft2-fontmap.c
parent6f623dc2dca270ef63f518a951411c1d614ffd4e (diff)
downloadpango-9d36c1dc2da9797cf08a915008c49570ff38578c.tar.gz
Free pattern after using it.
2002-03-26 Alex Larsson <alexl@redhat.com> * pango/pangoft2-fontmap.c (pango_ft2_font_map_load_font): Free pattern after using it.
Diffstat (limited to 'pango/pangoft2-fontmap.c')
-rw-r--r--pango/pangoft2-fontmap.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index c0077f1e..da1a7b0d 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -519,17 +519,23 @@ pango_ft2_font_map_load_font (PangoFontMap *fontmap,
{
MiniXftPattern *pattern, *match;
MiniXftResult res;
-
+ PangoFont *font;
+
pattern = pango_ft2_make_pattern (description);
match = MiniXftFontMatch ((Display *)1, 0, pattern, &res);
MiniXftPatternDestroy (pattern);
+
+ font = NULL;
if (match)
- return pango_ft2_font_map_new_font (fontmap, match);
+ {
+ font = pango_ft2_font_map_new_font (fontmap, match);
+ MiniXftPatternDestroy (match);
+ }
- return NULL;
+ return font;
}
static PangoFontset *