From ec3f33c6e177f397cdd3665e1b6b85d7b9cfe9ba Mon Sep 17 00:00:00 2001 From: bert hubert Date: Tue, 24 Nov 2015 16:59:22 +0100 Subject: [PATCH] obvious malloc cleanups --- pdns/dnsname.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index b95cf01e1..8bee721a8 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; } -- 2.40.0