From e56d259b8e8bd6c31968e8b9e9e19db12f4f939b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 3 Apr 2021 06:41:11 +0530 Subject: [PATCH] Also free() when loading fails --- kitty/graphics.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kitty/graphics.c b/kitty/graphics.c index ed166d00b..ae30fa778 100644 --- a/kitty/graphics.c +++ b/kitty/graphics.c @@ -329,6 +329,7 @@ png_path_to_bitmap(const char* path, uint8_t** data, unsigned int* width, unsign inflate_png_inner(&d, buf, pos); free(buf); if (!d.ok) { + free(d.decompressed); free(d.row_pointers); log_error("Failed to decode PNG image at: %s", path); return false; }