Changeset 1079

Show
Ignore:
Timestamp:
08/02/07 23:29:10 (3 years ago)
Author:
ahu
Message:

plug memory leak on packet building error caused by bogus database information

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/packethandler.cc

    r1078 r1079  
    897897    if(doAdditionalProcessingAndDropAA(p,r)<0) 
    898898      return 0; 
     899 
    899900    r->wrapup(); // needed for inserting in cache 
    900901    if(!noCache) 
     
    907908    S.ringAccount("servfail-queries",p->qdomain); 
    908909  } 
     910  catch(exception &e) { 
     911    L<<Logger::Error<<"Exception building anser packet ("<<e.what()<<") sending out servfail"<<endl; 
     912    delete r; 
     913    r=p->replyPacket();  // generate an empty reply packet     
     914    r->setRcode(RCode::ServFail); 
     915    S.inc("servfail-packets"); 
     916    S.ringAccount("servfail-queries",p->qdomain); 
     917  } 
    909918  return r;  
    910919