sixel: destroy(): don’t unref a NULL pixman image

This commit is contained in:
Daniel Eklöf 2021-07-18 16:30:42 +02:00
parent a577496f8f
commit f65e062ce4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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;
}