]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
throw fatal error on realloc failure
authorMark Andrews <marka@isc.org>
Sun, 9 Dec 2012 23:16:28 +0000 (10:16 +1100)
committerMark Andrews <marka@isc.org>
Sun, 9 Dec 2012 23:16:28 +0000 (10:16 +1100)
bin/dnssec/dnssec-signzone.c

index 4b8a0940859f76b606b60f98de23e6cdeb7ee305..c8bb54bfbc25b719813878d405c3b5d6db230950 100644 (file)
@@ -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);