From 289485bd50ba7ec9c0bffc1ccc7d2446a0cf004f Mon Sep 17 00:00:00 2001 From: bakkeby Date: Fri, 11 Mar 2022 10:17:31 +0100 Subject: [PATCH] background image: use xmalloc instead of malloc to exit st on malloc failures --- patch/background_image_x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch/background_image_x.c b/patch/background_image_x.c index bb019a9..fc7532c 100644 --- 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");