From df77d32b13dce3d6b96aef4310fd341e6b8b4ebe Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 8 Oct 2012 06:41:01 +0200 Subject: [PATCH] Fix memory leak. --- lib/taglyf.c | 1 + lib/ttfautohint.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/lib/taglyf.c b/lib/taglyf.c index 589bb9f..48f96e2 100644 --- a/lib/taglyf.c +++ b/lib/taglyf.c @@ -1231,6 +1231,7 @@ TA_sfnt_handle_coverage(SFNT* sfnt, error = ta_loader_reset(font, face); if (error) goto Exit; + ta_loader_done(font); font->fallback_script = saved_fallback_script; curr_globals = (TA_FaceGlobals)face->autohint.data; diff --git a/lib/ttfautohint.c b/lib/ttfautohint.c index 2f4b70a..e4177d5 100644 --- a/lib/ttfautohint.c +++ b/lib/ttfautohint.c @@ -422,6 +422,10 @@ TTF_autohint(const char* options, SFNT* sfnt = &font->sfnts[i]; + error = ta_loader_init(font); + if (error) + goto Err; + error = TA_sfnt_build_gasp_table(sfnt, font); if (error) goto Err; @@ -440,6 +444,9 @@ TTF_autohint(const char* options, error = TA_sfnt_build_loca_table(sfnt, font); if (error) goto Err; + + if (font->loader) + ta_loader_done(font); } for (i = 0; i < font->num_sfnts; i++) -- 2.11.4.GIT