From: Wouter Wijngaards Date: Mon, 7 Dec 2009 09:18:38 +0000 (+0000) Subject: Fix bug#287. X-Git-Tag: release-1.4.1~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ce514a384875199a51dd7b0c4c91d6fb2f2d70e;p=thirdparty%2Funbound.git Fix bug#287. git-svn-id: file:///svn/unbound/trunk@1926 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/services/localzone.c b/services/localzone.c index 60545dd61..9f20356a7 100644 --- a/services/localzone.c +++ b/services/localzone.c @@ -1309,14 +1309,16 @@ void local_zones_del_data(struct local_zones* zones, /* find the domain */ d = lz_find_node(z, name, len, labs); - /* no memory recycling for zone deletions ... */ - d->rrsets = NULL; - /* did we delete the soa record ? */ - if(query_dname_compare(d->name, z->name) == 0) - z->soa = NULL; - - /* cleanup the empty nonterminals for this name */ - del_empty_term(z, d, name, len, labs); + if(d) { + /* no memory recycling for zone deletions ... */ + d->rrsets = NULL; + /* did we delete the soa record ? */ + if(query_dname_compare(d->name, z->name) == 0) + z->soa = NULL; + + /* cleanup the empty nonterminals for this name */ + del_empty_term(z, d, name, len, labs); + } lock_rw_unlock(&z->lock); }