From 63fc7705f6c10f4b62c5e743f7fd79cf17e40b95 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 31 Mar 2017 16:06:42 +0200 Subject: [PATCH] rec: Use `make_shared` for unwanted query records, saves an allocation --- pdns/dnsparser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc index 8f6baa7cb..37493a086 100644 --- a/pdns/dnsparser.cc +++ b/pdns/dnsparser.cc @@ -286,7 +286,7 @@ void MOADNSParser::init(bool query, const char *packet, unsigned int len) if (query && (dr.d_place == DNSResourceRecord::ANSWER || dr.d_place == DNSResourceRecord::AUTHORITY || (dr.d_type != QType::OPT && dr.d_type != QType::TSIG && dr.d_type != QType::SIG && dr.d_type != QType::TKEY) || ((dr.d_type == QType::TSIG || dr.d_type == QType::SIG || dr.d_type == QType::TKEY) && dr.d_class != QClass::ANY))) { // cerr<<"discarding RR, query is "<(new UnknownRecordContent(dr, pr)); + dr.d_content=std::make_shared(dr, pr); } else { // cerr<<"parsing RR, query is "<