]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - modules/gmysqlbackend/smysql.cc
auth: Prevent temporary objects in the DNSBackend::get() overrides
[thirdparty/pdns.git] / modules / gmysqlbackend / smysql.cc
index 9de744c5aa6f4ba4ff90d79ec4f3eb7af4cf0199..74087425e262d9462638628033df0ff56c18e238 100644 (file)
@@ -283,10 +283,10 @@ public:
         g_log<<Logger::Warning<<"Result field at row " << d_residx << " column " << i << " has been truncated, we allocated " << d_res_bind[i].buffer_length << " bytes but at least " << *d_res_bind[i].length << " was needed" << endl;
       }
       if (*d_res_bind[i].is_null) {
-        row.push_back("");
+        row.emplace_back("");
         continue;
       } else {
-        row.push_back(string((char*)d_res_bind[i].buffer, std::min(d_res_bind[i].buffer_length, *d_res_bind[i].length)));
+        row.emplace_back((char*)d_res_bind[i].buffer, std::min(d_res_bind[i].buffer_length, *d_res_bind[i].length));
       }
     }
 
@@ -326,7 +326,7 @@ public:
 
     while(hasNextRow()) {
       nextRow(row);
-      result.push_back(row); 
+      result.push_back(std::move(row));
     }
 
     return this;