libansilove

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

commit 7b6717d8b9b161a5b80c441f54fe7f5e25b6e931
parent f617b01e7dfd4cef626bfe7231dfee7884de3743
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri, 16 Nov 2018 11:16:17 +0100

Only call gdFree() if the PNG buffer was allocated. From Joris Vink, thanks!

Diffstat:
Msrc/clean.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/clean.c b/src/clean.c @@ -19,7 +19,8 @@ ansilove_clean(struct ansilove_ctx *ctx) { if (ctx == NULL) return -1; - gdFree((void *)ctx->png.buffer); + if (ctx->png.buffer != NULL) + gdFree(ctx->png.buffer); ctx->png.length = 0; return 0;