diff --git a/lib/dns/qpcache.c b/lib/dns/qpcache.c index 54593ff91e..eaa6a6fed5 100644 --- a/lib/dns/qpcache.c +++ b/lib/dns/qpcache.c @@ -3825,11 +3825,12 @@ rdatasetiter_next(dns_rdatasetiter_t *it DNS__DB_FLARG) { if (header != NULL) { break; } + /* * Find the start of the header chain for the next type. */ - topheader = dns_slabheader_top(header); - topheader_next = topheader->next; + topheader = topheader->next; + header = topheader; } NODE_UNLOCK(nlock, &nlocktype); diff --git a/lib/dns/qpzone.c b/lib/dns/qpzone.c index 4bb17b6fb4..51f8452473 100644 --- a/lib/dns/qpzone.c +++ b/lib/dns/qpzone.c @@ -4145,11 +4145,12 @@ rdatasetiter_next(dns_rdatasetiter_t *iterator DNS__DB_FLARG) { if (header != NULL) { break; } + /* * Find the start of the header chain for the next type. */ - topheader = dns_slabheader_top(header); - topheader_next = topheader->next; + topheader = topheader->next; + header = topheader; } NODE_UNLOCK(nlock, &nlocktype);