]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Coverity 1469687: Dereference null return value
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 1 Apr 2022 10:22:29 +0000 (12:22 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 1 Apr 2022 10:22:29 +0000 (12:22 +0200)
pdns/dnsrecords.cc

index 4f581cbc0340def73b3d4cc6058132dad4545bf5..c6afdac811b56b4aea6b554cec82292caf9b6f38 100644 (file)
@@ -988,11 +988,13 @@ void reportAllTypes()
 
 ComboAddress getAddr(const DNSRecord& dr, uint16_t defport)
 {
-  if(auto addr=getRR<ARecordContent>(dr)) {
-    return addr->getCA(defport);
+  if (auto a = getRR<ARecordContent>(dr)) {
+    return a->getCA(defport);
   }
-  else
-    return getRR<AAAARecordContent>(dr)->getCA(defport);
+  else if (auto aaaa = getRR<AAAARecordContent>(dr)) {
+    return aaaa->getCA(defport);
+  }
+  return ComboAddress();
 }
 
 /**