aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-29 02:05:33 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-29 02:05:33 +0100
commit8da2d9bc15e5af48ba448755092504c64130a26e (patch)
tree09b7d9d24c8f34b1a3d9bffe675a51c920d83eb4
parent1915111da500459930755acbcb602125ff643847 (diff)
Fixed unchecked return values
-rw-r--r--FICS/makerank.c9
1 files changed, 9 insertions, 0 deletions
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__);
}
}
}