From 094e69641bb6dd01794dc72ca8b4ed3e3df82837 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Thu, 14 Dec 2023 00:09:03 +0100 Subject: Check malloc() return value --- FICS/makerank.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'FICS') diff --git a/FICS/makerank.c b/FICS/makerank.c index 72ee966..3336bca 100644 --- a/FICS/makerank.c +++ b/FICS/makerank.c @@ -113,7 +113,10 @@ LoadEntries(void) int listsize; listsize = 100; - list = malloc(sizeof(ENTRY *)*listsize); + list = malloc(sizeof(ENTRY *) * listsize); + + if (list == NULL) + err(1, "%s: malloc", __func__); for (letter1 = 'a'; letter1 <= 'z'; letter1++) { printf("Loading %c's.\n", letter1); -- cgit v1.2.3