From f4ea75a9bd112419e111f867b3b868864fbd322d Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 28 Jun 2019 15:21:12 +0200 Subject: [PATCH] auth: Fix a leak on 'Backend reported permanent error which prevented lookup' error --- pdns/distributor.hh | 4 ++-- pdns/packethandler.cc | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pdns/distributor.hh b/pdns/distributor.hh index ecc1509cd4..9efb928aff 100644 --- a/pdns/distributor.hh +++ b/pdns/distributor.hh @@ -193,7 +193,7 @@ templatevoid *MultiThreadDistributo if(read(us->d_pipes[ournum].first, &QD, sizeof(QD)) != sizeof(QD)) unixDie("read"); --us->d_queued; - Answer *a; + Answer *a = nullptr; if(queuetimeout && QD->Q->d_dt.udiff()>queuetimeout*1000) { delete QD->Q; @@ -267,7 +267,7 @@ retry: templateint SingleThreadDistributor::question(Question* q, callback_t callback) { - Answer *a; + Answer *a = nullptr; bool allowRetry=true; retry: try { diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index 7b1176d88a..fc15f5aad3 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -1100,7 +1100,7 @@ DNSPacket *PacketHandler::doQuestion(DNSPacket *p) DNSName haveAlias; uint8_t aliasScopeMask; - DNSPacket *r=0; + DNSPacket *r=nullptr; bool noCache=false; #ifdef HAVE_LUA_RECORDS @@ -1559,6 +1559,7 @@ DNSPacket *PacketHandler::doQuestion(DNSPacket *p) } catch(PDNSException &e) { g_log<