From 8da2d9bc15e5af48ba448755092504c64130a26e Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Fri, 29 Dec 2023 02:05:33 +0100 Subject: Fixed unchecked return values --- FICS/makerank.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'FICS') diff --git a/FICS/makerank.c b/FICS/makerank.c index dcac856..b1aa8de 100644 --- a/FICS/makerank.c +++ b/FICS/makerank.c @@ -164,6 +164,10 @@ LoadEntries(void) listsize += 100; list = realloc(list, listsize * sizeof(ENTRY *)); + if (list == NULL) { + err(1, "%s: realloc", + __func__); + } } } } @@ -233,6 +237,9 @@ makerank(void) sortmesize = 100; sortme = malloc(sizeof(ENTRY *) * sortmesize); + if (sortme == NULL) + err(1, "%s: malloc", __func__); + for (i = 0; i < n; i++) { if (list[i]->r[rtype].rating) { sortme[sortnum++] = list[i]; @@ -241,6 +248,8 @@ makerank(void) sortmesize += 100; sortme = realloc(sortme, sortmesize * sizeof(ENTRY *)); + if (sortme == NULL) + err(1, "%s: realloc", __func__); } } } -- cgit v1.2.3