From a76b52153559ba9c7d04720a74a138a858deb2aa Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 3 Sep 2004 08:04:50 +0000 Subject: [PATCH] (mfont__ft_drive_otf): Use malloc and free for otf_gstring.glyphs. --- src/font-ft.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/font-ft.c b/src/font-ft.c index c1b3031..6d845fc 100644 --- a/src/font-ft.c +++ b/src/font-ft.c @@ -965,7 +965,7 @@ mfont__ft_drive_otf (MGlyphString *gstring, int from, int to, gpos_feature_names = NULL; otf_gstring.size = otf_gstring.used = len; - otf_gstring.glyphs = (OTF_Glyph *) alloca (sizeof (OTF_Glyph) * len); + otf_gstring.glyphs = (OTF_Glyph *) malloc (sizeof (OTF_Glyph) * len); memset (otf_gstring.glyphs, 0, sizeof (OTF_Glyph) * len); for (i = 0, need_cmap = 0; i < len; i++) { @@ -1111,6 +1111,7 @@ mfont__ft_drive_otf (MGlyphString *gstring, int from, int to, base = g; } } + free (otf_gstring.glyphs); return to; simple_copy: @@ -1120,6 +1121,7 @@ mfont__ft_drive_otf (MGlyphString *gstring, int from, int to, MGlyph temp = gstring->glyphs[from + i]; MLIST_APPEND1 (gstring, glyphs, temp, MERROR_FONT_OTF); } + free (otf_gstring.glyphs); return to; } -- 1.7.10.4