mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 07:49:59 -04:00
throw fatal error on realloc failure
This commit is contained in:
parent
463f4ad70b
commit
040dc29236
1 changed files with 2 additions and 0 deletions
|
|
@ -720,6 +720,8 @@ hashlist_add(hashlist_t *l, const unsigned char *hash, size_t len)
|
|||
if (l->entries == l->size) {
|
||||
l->size = l->size * 2 + 100;
|
||||
l->hashbuf = realloc(l->hashbuf, l->size * l->length);
|
||||
if (l->hashbuf == NULL)
|
||||
fatal("unable to grow hashlist: out of memory");
|
||||
}
|
||||
memset(l->hashbuf + l->entries * l->length, 0, l->length);
|
||||
memcpy(l->hashbuf + l->entries * l->length, hash, len);
|
||||
|
|
|
|||
Loading…
Reference in a new issue