From 737224a85305d673fc17f14adfd23b6d70eb9aa8 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 8 May 2011 19:45:38 +0000 Subject: Fix cleanup to cope with things not being initialised svn path=/trunk/tools/ttf2f/; revision=12315 --- src/cli.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/cli.c b/src/cli.c index 751329e..9b31598 100644 --- a/src/cli.c +++ b/src/cli.c @@ -155,14 +155,18 @@ error_out: } } - free(ctx.metrics->name_copyright); - free(ctx.metrics->name_full); - free(ctx.metrics->name_version); - free(ctx.metrics->name_ps); - free(ctx.metrics); + if (ctx.metrics != NULL) { + free(ctx.metrics->name_copyright); + free(ctx.metrics->name_full); + free(ctx.metrics->name_version); + free(ctx.metrics->name_ps); + free(ctx.metrics); + } + free(ctx.glyphs); - close_font(ctx.face); + if (ctx.face != NULL) + close_font(ctx.face); ft_fini(); glyph_destroy_list(); -- cgit v1.2.3