From b4b213da251d04ca5bc1315f09249f5597a81d83 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 29 Mar 2018 11:37:27 +0200 Subject: [PATCH] dnsdist: Only copy the DNSName, not the whole ring entry --- pdns/dnsdist-lua-inspection.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pdns/dnsdist-lua-inspection.cc b/pdns/dnsdist-lua-inspection.cc index f8829d88f..0c28d1e5a 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++; } } -- 2.40.0