From 8ae4f2bcd7cf3c72f89777f3c1e8b606b47aae73 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 28 Mar 2022 11:07:46 +0200 Subject: [PATCH] Comment on the two remaining scanbuild cases. At first sight these are both false positives. --- pdns/lwres.cc | 2 +- pdns/recursordist/rec-main.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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) { -- 2.47.2