Removed hard malloc failure reported by Greg Woods.

git-svn-id: file:///svn/unbound/trunk@1876 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2009-10-28 08:04:38 +00:00
parent 9bb3fdd547
commit d3bc6d6b5a
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,6 @@
29 October 2009: Wouter
- removed abort on prealloc failure, error still printed but softfail.
27 October 2009: Wouter
- iana portlist updated.

View file

@ -69,8 +69,10 @@ prealloc(struct alloc_cache* alloc)
alloc_special_t* p;
int i;
for(i=0; i<ALLOC_SPECIAL_MAX; i++) {
if(!(p = (alloc_special_t*)malloc(sizeof(alloc_special_t))))
fatal_exit("prealloc: out of memory");
if(!(p = (alloc_special_t*)malloc(sizeof(alloc_special_t)))) {
log_err("prealloc: out of memory");
return;
}
alloc_setup_special(p);
alloc_set_special_next(p, alloc->quar);
alloc->quar = p;
@ -86,7 +88,10 @@ prealloc_blocks(struct alloc_cache* alloc, size_t num)
struct regional* r;
for(i=0; i<num; i++) {
r = regional_create_custom(ALLOC_REG_SIZE);
if(!r) fatal_exit("prealloc blocks: out of memory");
if(!r) {
log_err("prealloc blocks: out of memory");
return;
}
r->next = (char*)alloc->reg_list;
alloc->reg_list = r;
alloc->num_reg_blocks ++;