commit 289485bd50ba7ec9c0bffc1ccc7d2446a0cf004f
parent faac64e392aece75fa3c410e0ce2fb853d7d1e5d
Author: bakkeby <bakkeby@gmail.com>
Date: Fri, 11 Mar 2022 10:17:31 +0100
background image: use xmalloc instead of malloc to exit st on malloc failures
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/patch/background_image_x.c b/patch/background_image_x.c
@@ -35,7 +35,7 @@ loadff(const char *filename)
w = ntohl(hdr[2]);
h = ntohl(hdr[3]);
size = w * h;
- data = malloc(size * sizeof(uint64_t));
+ data = xmalloc(size * sizeof(uint64_t));
if (fread(data, sizeof(uint64_t), size, f) != size) {
fprintf(stderr, "fread: %s\n", ferror(f) ? "" : "Unexpected end of file reading data");