From: Otto Moerbeek Date: Mon, 31 Jan 2022 11:44:39 +0000 (+0100) Subject: Initialize isNew before calling a exception throwing function X-Git-Tag: auth-4.7.0-alpha1~34^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4043238ede86eb42dad0bd4eae0b51cb351e80ab;p=thirdparty%2Fpdns.git Initialize isNew before calling a exception throwing function --- diff --git a/pdns/lwres.cc b/pdns/lwres.cc index 16aa2c47cf..90f1c84d4d 100644 --- a/pdns/lwres.cc +++ b/pdns/lwres.cc @@ -441,6 +441,7 @@ static LWResult::Result asyncresolve(const ComboAddress& ip, const DNSName& doma // work, we give up. For reused connections, we assume the // peer has closed it on error, so we retry. At some point we // *will* get a new connection, so this loop is not endless. + isNew = true; // tcpconnect() might throw for new connections. In that case, we want to break the loop isNew = tcpconnect(*now, ip, connection, dnsOverTLS); ret = tcpsendrecv(ip, connection, localip, vpacket, len, buf); #ifdef HAVE_FSTRM