From: Remi Gacogne Date: Fri, 31 Mar 2017 14:06:42 +0000 (+0200) Subject: rec: Use `make_shared` for unwanted query records, saves an allocation X-Git-Tag: rec-4.1.0-alpha1~174^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63fc7705f6c10f4b62c5e743f7fd79cf17e40b95;p=thirdparty%2Fpdns.git rec: Use `make_shared` for unwanted query records, saves an allocation --- diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc index 8f6baa7cbe..37493a0863 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 "<