From d6a01789e24fd569581af5f605bbf3f7a33dd516 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 7 Jan 2024 21:54:00 +0100 Subject: [PATCH] calloc --- client/src/cmdhfwaveshare.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/cmdhfwaveshare.c b/client/src/cmdhfwaveshare.c index 7dfef808c..c45f19f8a 100644 --- a/client/src/cmdhfwaveshare.c +++ b/client/src/cmdhfwaveshare.c @@ -85,7 +85,7 @@ static uint8_t * map8to1(gdImagePtr img, int color) { // Calculate width rounding up uint16_t width8 = (gdImageSX(img) + 7) / 8; - uint8_t * colormap8 = malloc(width8 * gdImageSY(img)); + uint8_t * colormap8 = calloc(width8 * gdImageSY(img), sizeof(uint8_t)); if (!colormap8) { return NULL; }