aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sixel.c5
1 files 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;
}