From: Mark Andrews Date: Sun, 9 Dec 2012 23:16:28 +0000 (+1100) Subject: throw fatal error on realloc failure X-Git-Tag: v9.10.0a1~661 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=040dc292364361b8ad3b549a275b712920afe4dc;p=thirdparty%2Fbind9.git throw fatal error on realloc failure --- diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c index 4b8a0940859..c8bb54bfbc2 100644 --- a/bin/dnssec/dnssec-signzone.c +++ b/bin/dnssec/dnssec-signzone.c @@ -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);