Parcourir la source

[1608] avoid returning a reference from getAdditionalName() for safety.

In this specific case I believe it was actually safe, but making a copy
is clearly safer.  And this function doesn't have to be super fast anyway.
JINMEI Tatuya il y a 13 ans
Parent
commit
a2d27b3d05
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/lib/datasrc/memory_datasrc.cc

+ 1 - 1
src/lib/datasrc/memory_datasrc.cc

@@ -1289,7 +1289,7 @@ InMemoryZoneFinder::add(const ConstRRsetPtr& rrset) {
 
 namespace {
 // This should eventually be more generalized.
-const Name&
+const Name
 getAdditionalName(RRType rrtype, const rdata::Rdata& rdata) {
     if (rrtype == RRType::NS()) {
         const generic::NS& ns = dynamic_cast<const generic::NS&>(rdata);