summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-05-08 19:45:38 (GMT)
committer John Mark Bell <jmb@netsurf-browser.org>2011-05-08 19:45:38 (GMT)
commit737224a85305d673fc17f14adfd23b6d70eb9aa8 (patch)
tree4ffdbdb63ad2d59fc75628ba8aeda4d747860ae0
parent09c7169e7b743b588bb2900b6b4ae13ef5e088ba (diff)
downloadttf2f-737224a85305d673fc17f14adfd23b6d70eb9aa8.tar.gz
ttf2f-737224a85305d673fc17f14adfd23b6d70eb9aa8.tar.bz2
Fix cleanup to cope with things not being initialised
svn path=/trunk/tools/ttf2f/; revision=12315
-rw-r--r--src/cli.c16
1 files changed, 10 insertions, 6 deletions
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();