diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-01-04 23:14:21 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-01-05 07:59:28 -0500 |
commit | 694cb9ee0af00c38e036bf693d01ae9739e68f2b (patch) | |
tree | 1e2cfceaf1d4c0c7e8057dc0a182b35136d26b13 /pango | |
parent | 6193498961cd334086c3d665d1d856454e16d1b4 (diff) | |
download | pango-694cb9ee0af00c38e036bf693d01ae9739e68f2b.tar.gz |
Avoid a memory leak
We call pango_fc_font_key_init on a stack-allocated temporary
lookup key, with the expectation that it does not have to be
freed. In the case where we want to use it as key in the font_hash,
we call copy() on it. So, don't duplicate the variations string
in init() - it will get duplicated in copy() later.
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pangofc-fontmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c index 0f3a08d0..9ed9d959 100644 --- a/pango/pangofc-fontmap.c +++ b/pango/pangofc-fontmap.c @@ -656,7 +656,7 @@ pango_fc_font_key_init (PangoFcFontKey *key, key->fontmap = fcfontmap; key->pattern = pattern; key->matrix = *pango_fc_fontset_key_get_matrix (fontset_key); - key->variations = g_strdup (fontset_key->variations); + key->variations = fontset_key->variations; key->context_key = pango_fc_fontset_key_get_context_key (fontset_key); } |