From: Otto Moerbeek Date: Mon, 20 Jan 2025 08:41:38 +0000 (+0100) Subject: rec: Coverity issues missed in last round, all severity "Low" X-Git-Tag: dnsdist-2.0.0-alpha1~159^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F15057%2Fhead;p=thirdparty%2Fpdns.git rec: Coverity issues missed in last round, all severity "Low" 1587809 Variable copied when it could be moved 1587817 Variable copied when it could be moved 1587819 Variable copied when it could be moved --- diff --git a/pdns/recursordist/rec-zonetocache.cc b/pdns/recursordist/rec-zonetocache.cc index 4833f8ac7c..d4f71f14d1 100644 --- a/pdns/recursordist/rec-zonetocache.cc +++ b/pdns/recursordist/rec-zonetocache.cc @@ -106,7 +106,7 @@ void ZoneData::parseDRForCache(DNSRecord& dnsRecord) const auto sigkey = pair(key.first, rrsig->d_type); auto found = d_sigs.find(sigkey); if (found != d_sigs.end()) { - found->second.push_back(rrsig); + found->second.push_back(std::move(rrsig)); } else { vector> sigsrr; diff --git a/pdns/recursordist/syncres.cc b/pdns/recursordist/syncres.cc index f19e458539..3e4f5a941d 100644 --- a/pdns/recursordist/syncres.cc +++ b/pdns/recursordist/syncres.cc @@ -1049,7 +1049,7 @@ int SyncRes::AuthDomain::getRecords(const DNSName& qname, const QType qtype, std for (ziter = range.first; ziter != range.second; ++ziter) { DNSRecord dnsRecord = *ziter; dnsRecord.d_place = DNSResourceRecord::AUTHORITY; - records.push_back(dnsRecord); + records.push_back(std::move(dnsRecord)); } } @@ -3105,7 +3105,7 @@ bool SyncRes::doCacheCheck(const DNSName& qname, const DNSName& authname, bool w for (const auto& rec : *authorityRecs) { DNSRecord dnsRecord(rec); dnsRecord.d_ttl = ttl; - ret.push_back(dnsRecord); + ret.push_back(std::move(dnsRecord)); } LOG(endl);