Do not use NULL palette when clearing.

This commit is contained in:
nicm 2021-08-14 14:00:07 +00:00
parent 4cc6db7281
commit befe7cb1c5

View File

@ -959,10 +959,10 @@ colour_palette_init(struct colour_palette *p)
void
colour_palette_clear(struct colour_palette *p)
{
p->fg = 8;
p->bg = 8;
if (p != NULL) {
free(p->palette);
p->fg = 8;
p->bg = 8;
free(p->palette);
p->palette = NULL;
}
}