]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Prevent a copy in RecursorLua4::DNSQuestion::addAnswer
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 1 Aug 2023 13:09:25 +0000 (15:09 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 22 Sep 2023 08:20:03 +0000 (10:20 +0200)
Reported by Coverity as 1509322

(cherry picked from commit 86867a80b19a40644e5d5d1c2dcacccb70695b85)

pdns/recursordist/lua-recursor4.cc

index b35cfd0d943396db77b48c06bd30ee4134b3b8af..04c538025cd58d5c1914d25afb163a6e9d847cd3 100644 (file)
@@ -140,7 +140,7 @@ void RecursorLua4::DNSQuestion::addRecord(uint16_t type, const std::string& cont
 
 void RecursorLua4::DNSQuestion::addAnswer(uint16_t type, const std::string& content, boost::optional<int> ttl, boost::optional<string> name)
 {
-  addRecord(type, content, DNSResourceRecord::ANSWER, ttl, name);
+  addRecord(type, content, DNSResourceRecord::ANSWER, ttl, std::move(name));
 }
 
 struct DynMetric