]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Coverity issues missed in last round, all severity "Low" 15057/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 20 Jan 2025 08:41:38 +0000 (09:41 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 20 Jan 2025 08:41:38 +0000 (09:41 +0100)
1587809 Variable copied when it could be moved
1587817 Variable copied when it could be moved
1587819 Variable copied when it could be moved

pdns/recursordist/rec-zonetocache.cc
pdns/recursordist/syncres.cc

index 4833f8ac7c40a25a552bb975e4a87368478b08dc..d4f71f14d1ae947b7db02b27c4d7b56a2eee4c03 100644 (file)
@@ -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<shared_ptr<const RRSIGRecordContent>> sigsrr;
index f19e45853900775a1dc9f221f4a3cf10ad9147c9..3e4f5a941d65a5efb4ebf39936907a0c5032a40d 100644 (file)
@@ -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);