From e22cac1c60441a4f4cc2d6497ef9dbef7737eb4d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 9 Feb 2024 17:40:16 -0800 Subject: [PATCH] fix memory leak parameter is not passed by value but by reference. Treat it that way. Signed-off-by: Rosen Penev --- pdns/pdnsutil.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index c02b295d7aac..03984d8aef51 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -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."<{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()) {