From 66b24c3cb2bd73bf4e0551e2b26807703c1eb432 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Mon, 31 May 2010 12:46:24 +0000 Subject: [PATCH] fix to run longer in out of memory conditions git-svn-id: file:///svn/unbound/trunk@2121 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 2 ++ util/alloc.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 240e25814..a9c23af67 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,8 @@ 31 May 2010: Wouter - Fix AD flag handling, it could in some cases mistakenly copy the AD flag from upstream servers. + - alloc_special_obtain out of memory is not a fatal error any more, + enabling unbound to continue longer in out of memory conditions. 28 May 2010: Wouter - iana portlist updated. diff --git a/util/alloc.c b/util/alloc.c index 62cbec04b..49fa4f343 100644 --- a/util/alloc.c +++ b/util/alloc.c @@ -217,8 +217,10 @@ alloc_special_obtain(struct alloc_cache* alloc) } /* allocate new */ prealloc(alloc); - if(!(p = (alloc_special_t*)malloc(sizeof(alloc_special_t)))) - fatal_exit("alloc_special_obtain: out of memory"); + if(!(p = (alloc_special_t*)malloc(sizeof(alloc_special_t)))) { + log_err("alloc_special_obtain: out of memory"); + return NULL; + } alloc_setup_special(p); p->id = alloc_get_id(alloc); return p;