diff options
Diffstat (limited to 'testcode/unitecs.c')
| -rw-r--r-- | testcode/unitecs.c | 1 |
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); } |
