]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Prevent a copy when distributing UDP queries to workers 13092/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 1 Aug 2023 13:09:59 +0000 (15:09 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 1 Aug 2023 13:09:59 +0000 (15:09 +0200)
Reported by Coverity as CID 1509301.

pdns/recursordist/pdns_recursor.cc

index 6087df604ffd828635b3dbc568bde15c4370164f..9f34d34c469ab704cfb809f1196ff6f3b28d4711 100644 (file)
@@ -2570,7 +2570,7 @@ static void handleNewUDPQuestion(int fileDesc, FDMultiplexer::funcparam_t& /* va
 
           if (RecThreadInfo::weDistributeQueries()) {
             std::string localdata = data;
-            distributeAsyncFunction(data, [localdata, fromaddr, destaddr, source, destination, mappedSource, tval, fileDesc, proxyProtocolValues, eventTrace]() mutable {
+            distributeAsyncFunction(data, [localdata = std::move(localdata), fromaddr, destaddr, source, destination, mappedSource, tval, fileDesc, proxyProtocolValues, eventTrace]() mutable {
               return doProcessUDPQuestion(localdata, fromaddr, destaddr, source, destination, mappedSource, tval, fileDesc, proxyProtocolValues, eventTrace);
             });
           }