From f65e062ce4defaa647b43927e462eaf2d683942b Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 18 Jul 2021 16:30:42 +0200 Subject: sixel: destroy(): don’t unref a NULL pixman image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sixel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sixel.c b/sixel.c index 86878978..18a9c146 100644 --- a/sixel.c +++ b/sixel.c @@ -88,9 +88,10 @@ sixel_init(struct terminal *term, int p1, int p2, int p3) void sixel_destroy(struct sixel *sixel) { - pixman_image_unref(sixel->pix); - free(sixel->data); + if (sixel->pix != NULL) + pixman_image_unref(sixel->pix); + free(sixel->data); sixel->pix = NULL; sixel->data = NULL; } -- cgit v1.3