summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/demo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/demo.c b/src/demo.c
index 6ee46b0..4e57b45 100644
--- a/src/demo.c
+++ b/src/demo.c
@@ -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;