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 Feb 12, 2024
1 parent d0174ef commit 995bc5c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pdns/pdnsutil.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <boost/smart_ptr/make_shared_array.hpp>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down Expand Up @@ -913,10 +912,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 995bc5c

Please sign in to comment.