From: bert hubert Date: Tue, 24 Nov 2015 15:59:22 +0000 (+0100) Subject: obvious malloc cleanups X-Git-Tag: dnsdist-1.0.0-alpha1~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec3f33c6e177f397cdd3665e1b6b85d7b9cfe9ba;p=thirdparty%2Fpdns.git obvious malloc cleanups --- diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index b95cf01e16..8bee721a84 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -230,7 +230,7 @@ bool DNSName::slowCanonCompare(const DNSName& rhs) const vector DNSName::getRawLabels() const { vector ret; - + ret.reserve(countLabels()); // 3www4ds9a2nl0 for(const char* p = d_storage.c_str(); p < d_storage.c_str() + d_storage.size() && *p; p+=*p+1) ret.push_back({p+1, (unsigned int)*p}); // XXX FIXME @@ -242,7 +242,7 @@ bool DNSName::chopOff() { if(d_storage.empty() || d_storage[0]==0) return false; - d_storage = d_storage.substr((unsigned int)d_storage[0]+1); + d_storage.erase(0, (unsigned int)d_storage[0]+1); return true; }