Skip to content

Commit

Permalink
fix memory leak
Browse files Browse the repository at this point in the history
parameter is not passed by value but by reference. Treat it that way.

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Jun 5, 2024
1 parent 96b48ed commit e22cac1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pdns/pdnsutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit e22cac1

Please sign in to comment.