From 8390d626f9e28110fde949c2f4360c07ea6abad2 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 30 Sep 2006 18:06:47 +0000 Subject: [PATCH] * Fixed a few unimportant memory leaks upon error. --- src/figlet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/figlet.c b/src/figlet.c index 575d5a7..6e62d87 100644 --- a/src/figlet.c +++ b/src/figlet.c @@ -161,6 +161,7 @@ static struct figfont *open_font(void) if(!ret) { free(data); + free(font->lookup); free(font); fprintf(stderr, "read error at glyph %u in `%s'\n", font->glyphs, path); @@ -192,6 +193,7 @@ static struct figfont *open_font(void) if(font->glyphs < EXT_GLYPHS) { free(data); + free(font->lookup); free(font); fprintf(stderr, "only %u glyphs in `%s', expected at least %u\n", font->glyphs, path, EXT_GLYPHS); @@ -206,7 +208,7 @@ static struct figfont *open_font(void) if(!font->image) { - cucul_free_canvas(font->image); + free(font->lookup); free(font); fprintf(stderr, "libcucul could not load data in `%s'\n", path); return NULL;