From: Remi Gacogne Date: Thu, 29 Mar 2018 09:37:27 +0000 (+0200) Subject: dnsdist: Only copy the DNSName, not the whole ring entry X-Git-Tag: dnsdist-1.3.0~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6191%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Only copy the DNSName, not the whole ring entry --- diff --git a/pdns/dnsdist-lua-inspection.cc b/pdns/dnsdist-lua-inspection.cc index f8829d88f5..0c28d1e5a5 100644 --- a/pdns/dnsdist-lua-inspection.cc +++ b/pdns/dnsdist-lua-inspection.cc @@ -44,12 +44,13 @@ static std::unordered_map>> g } else { unsigned int lab = *labels; - for(auto a : shard->respRing) { + for(const auto& a : shard->respRing) { if(!pred(a)) continue; - a.name.trimToLabels(lab); - counts[a.name]++; + DNSName temp(a.name); + temp.trimToLabels(lab); + counts[temp]++; total++; } }