From: Otto Moerbeek Date: Mon, 28 Mar 2022 09:07:46 +0000 (+0200) Subject: Comment on the two remaining scanbuild cases. At first sight these are both false... X-Git-Tag: rec-4.7.0-beta1~31^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11470%2Fhead;p=thirdparty%2Fpdns.git Comment on the two remaining scanbuild cases. At first sight these are both false positives. --- diff --git a/pdns/lwres.cc b/pdns/lwres.cc index 933b469b87..c100c05037 100644 --- a/pdns/lwres.cc +++ b/pdns/lwres.cc @@ -441,7 +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 = true; // tcpconnect() might throw for new connections. In that case, we want to break the loop, scanbuild complains here, which is a false positive afaik std::string nsName; if (context && !context->d_nsName.empty()) { nsName = context->d_nsName.toStringNoDot(); diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index cbf4c85a8a..dc9b1f3e85 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -2712,6 +2712,7 @@ struct WipeCacheResult wipeCaches(const DNSName& canon, bool subtree, uint16_t q try { res.record_count = g_recCache->doWipeCache(canon, subtree, qtype); + // scanbuild complains here about an allocated function object that is being leaked. Needs investigation res.packet_count = broadcastAccFunction([=] { return pleaseWipePacketCache(canon, subtree, qtype); }); res.negative_record_count = g_negCache->wipe(canon, subtree); if (g_aggressiveNSECCache) {