diff options
-rw-r--r-- | src/demo.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -125,7 +125,13 @@ demo(void) SDL_Palette *pal_start, *pal_end; pal = malloc(sizeof(*pal)); + if (pal == NULL) { + err(1, "Failed to allocate palette"); + } pal->colors = calloc(64, sizeof(*pal->colors)); + if (pal->colors == NULL) { + err(1, "Failed to allocate palette colors"); + } pal->ncolors = 64; i = 0; |