From: Bert Hubert Date: Tue, 2 Mar 2010 17:58:09 +0000 (+0000) Subject: no longer get confused by empty lines in the forward-zones-file. again discovered... X-Git-Tag: rec-3.2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e58483cc84d920584ab3cfeec38805317a40baed;p=pdns no longer get confused by empty lines in the forward-zones-file. again discovered by Imre Gergely, this closes ticket 273. git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1533 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/reczones.cc b/pdns/reczones.cc index bb6ca52d3..98556ba0c 100644 --- a/pdns/reczones.cc +++ b/pdns/reczones.cc @@ -358,6 +358,9 @@ SyncRes::domainmap_t* parseAuthAndForwards() tie(domain, instructions)=splitField(line, '='); trim(domain); trim(instructions); + if(domain.empty() && instructions.empty()) { // empty line + continue; + } if(boost::starts_with(domain,"+")) { domain=domain.c_str()+1; ad.d_rdForward = true; @@ -365,7 +368,7 @@ SyncRes::domainmap_t* parseAuthAndForwards() else ad.d_rdForward = false; if(domain.empty()) { - delete newMap; + delete newMap; throw AhuException("Error parsing line "+lexical_cast(linenum)+" of " +::arg()["forward-zones-file"]); } @@ -373,7 +376,7 @@ SyncRes::domainmap_t* parseAuthAndForwards() convertServersForAD(instructions, ad, ",; ", false); } catch(...) { - delete newMap; + delete newMap; throw AhuException("Conversion error parsing line "+lexical_cast(linenum)+" of " +::arg()["forward-zones-file"]); }