From 040dc292364361b8ad3b549a275b712920afe4dc Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 10 Dec 2012 10:16:28 +1100 Subject: [PATCH] throw fatal error on realloc failure --- bin/dnssec/dnssec-signzone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c index 4b8a094085..c8bb54bfbc 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);