]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fix memory leak 13776/head
authorRosen Penev <rosenp@gmail.com>
Sat, 10 Feb 2024 01:40:16 +0000 (17:40 -0800)
committerRosen Penev <rosenp@gmail.com>
Wed, 5 Jun 2024 02:12:28 +0000 (19:12 -0700)
parameter is not passed by value but by reference. Treat it that way.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
pdns/pdnsutil.cc

index c02b295d7aac3769e373062bb48d43f0ad2db940..03984d8aef510944403f5ebf3a974c190d6842b2 100644 (file)
@@ -924,10 +924,11 @@ static int increaseSerial(const DNSName& zone, DNSSECKeeper &dk)
 
   sd.db->startTransaction(zone, -1);
 
-  if (!sd.db->replaceRRSet(sd.domain_id, zone, rr.qtype, {rr})) {
-   sd.db->abortTransaction();
-   cerr<<"Backend did not replace SOA record. Backend might not support this operation."<<endl;
-   return -1;
+  auto rrs = vector<DNSResourceRecord>{rr};
+  if (!sd.db->replaceRRSet(sd.domain_id, zone, rr.qtype, rrs)) {
+    sd.db->abortTransaction();
+    cerr << "Backend did not replace SOA record. Backend might not support this operation." << endl;
+    return -1;
   }
 
   if (sd.db->doesDNSSEC()) {