From: bert hubert Date: Thu, 15 Jan 2015 12:08:16 +0000 (+0100) Subject: shave a whole bunch of replace_all calls & resulting allocations X-Git-Tag: rec-3.7.0-rc1~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83b746fd1d94c8742d8bd87a44beb44c154230c7;p=thirdparty%2Fpdns.git shave a whole bunch of replace_all calls & resulting allocations --- diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc index 776b51a521..f6ca6b6b62 100644 --- a/pdns/dnsparser.cc +++ b/pdns/dnsparser.cc @@ -531,9 +531,11 @@ string simpleCompress(const string& elabel, const string& root) { string label=elabel; // FIXME: this relies on the semi-canonical escaped output from getLabelFromContent - boost::replace_all(label, "\\.", "."); - boost::replace_all(label, "\\032", " "); - boost::replace_all(label, "\\\\", "\\"); + if(strchr(label.c_str(), '\\')) { + boost::replace_all(label, "\\.", "."); + boost::replace_all(label, "\\032", " "); + boost::replace_all(label, "\\\\", "\\"); + } typedef vector > parts_t; parts_t parts; vstringtok(parts, label, ".");