- Fix unit test for ecs to check for malloc success.

This commit is contained in:
W.C.A. Wijngaards
2026-06-09 16:41:37 +02:00
parent 39e67508c9
commit e7a713a525
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -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);
}