From f65e062ce4defaa647b43927e462eaf2d683942b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 18 Jul 2021 16:30:42 +0200 Subject: [PATCH] =?UTF-8?q?sixel:=20destroy():=20don=E2=80=99t=20unref=20a?= =?UTF-8?q?=20NULL=20pixman=20image?= 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; }