aboutsummaryrefslogtreecommitdiff
path: root/testcode/unitecs.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2026-08-04 10:04:44 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2026-08-04 10:04:44 +0000
commit84ffc29dc8ddb0c946db5cb3b3c1310bec6a9e6c (patch)
tree93f0b0071b6b34da50dd62dae3cee8ed757676e8 /testcode/unitecs.c
parentc68e7bcd81d62e9f5364c6da22fd9917976acf85 (diff)
Diffstat (limited to 'testcode/unitecs.c')
-rw-r--r--testcode/unitecs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/testcode/unitecs.c b/testcode/unitecs.c
index 68d6907f81a7..1f3c63b0f026 100644
--- a/testcode/unitecs.c
+++ b/testcode/unitecs.c
@@ -141,6 +141,7 @@ static addrlen_t randomkey(addrkey_t **k, int maxlen)
int bits = rand() % maxlen;
int bytes = bits/8 + (bits%8>0); /*ceil*/
*k = (addrkey_t *) malloc(bytes * sizeof(addrkey_t));
+ if(!*k) fatal_exit("out of memory");
for (byte = 0; byte < bytes; byte++) {
(*k)[byte] = (addrkey_t)(rand() & 0xFF);
}