From 1d17859b7d460eff5df1434587cdcf65a0f3994c Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 1 Apr 2022 12:22:29 +0200 Subject: [PATCH] Coverity 1469687: Dereference null return value --- pdns/dnsrecords.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index 4f581cbc03..c6afdac811 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -988,11 +988,13 @@ void reportAllTypes() ComboAddress getAddr(const DNSRecord& dr, uint16_t defport) { - if(auto addr=getRR(dr)) { - return addr->getCA(defport); + if (auto a = getRR(dr)) { + return a->getCA(defport); } - else - return getRR(dr)->getCA(defport); + else if (auto aaaa = getRR(dr)) { + return aaaa->getCA(defport); + } + return ComboAddress(); } /** -- 2.47.2