libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit fb6fd2fde8bd76e795cb4d78d3eeb05ec6b16d75
parent 6ee4e7018b560767dfa98732eff2f7118804f82a
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 31 Oct 2018 22:43:02 +0100

Do proper cleanup on error path in the XBin loader

Diffstat:
Msrc/loaders/xbin.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -184,8 +184,11 @@ int ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) } // create output file - if (output(ctx, options, canvas) != 0) + if (output(ctx, options, canvas) != 0) { + free(font_data_xbin); + font_data = NULL; return -1; + } // nuke garbage free(font_data_xbin);