]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Removed hard malloc failure reported by Greg Woods.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 28 Oct 2009 08:04:38 +0000 (08:04 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 28 Oct 2009 08:04:38 +0000 (08:04 +0000)
git-svn-id: file:///svn/unbound/trunk@1876 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/alloc.c

index 6df5a9a9a05b64ec618e75dcc947bdde1e0e5afe..043518a89d1c37ddf171be19ce38aea3f7c70b41 100644 (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.
 
index 73a354319bfe4ab6c810ab14e016d10d8eaef18f..3fe09f7904af2375e0264bc60b01d0b85c7b55ca 100644 (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 ++;