]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Initialize isNew before calling a exception throwing function 11257/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 31 Jan 2022 11:44:39 +0000 (12:44 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 31 Jan 2022 11:44:39 +0000 (12:44 +0100)
pdns/lwres.cc

index 16aa2c47cfaec1abf48b868d5b1fdfa8a938e9cb..90f1c84d4d49be766d213d1b7f909ca80e82b584 100644 (file)
@@ -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