Fix VS Code analysis warning

Should settle issue #239
This commit is contained in:
Willem Toorop 2017-04-13 10:59:20 +02:00
parent eb69cc8695
commit 691d1a77e6
2 changed files with 17 additions and 6 deletions

View File

@ -1104,10 +1104,8 @@ static void val_chain_node_soa_cb(getdns_dns_req *dnsreq)
; i = _getdns_rrset_iter_next(i)) {
rrset = _getdns_rrset_iter_value(i);
if (rrset->rr_type == GETDNS_RRTYPE_SOA)
break;
}
if (i) {
if (rrset->rr_type != GETDNS_RRTYPE_SOA)
continue;
while (node &&
! _dname_equal(node->ds.name, rrset->name))
@ -1124,8 +1122,9 @@ static void val_chain_node_soa_cb(getdns_dns_req *dnsreq)
val_chain_sched_soa_node(node->parent);
}
}
} else if (node->parent) {
break;
}
if (!i && node->parent) {
node->lock++;
val_chain_sched_soa_node(node->parent);
}

View File

@ -195,14 +195,22 @@ char* gldns_wire2str_type(uint16_t rrtype)
{
char buf[16];
gldns_wire2str_type_buf(rrtype, buf, sizeof(buf));
#ifndef USE_WINSOCK
return strdup(buf);
#else
return _strdup(buf);
#endif
}
char* gldns_wire2str_class(uint16_t rrclass)
{
char buf[16];
gldns_wire2str_class_buf(rrclass, buf, sizeof(buf));
#ifndef USE_WINSOCK
return strdup(buf);
#else
return _strdup(buf);
#endif
}
char* gldns_wire2str_dname(uint8_t* dname, size_t dname_len)
@ -218,7 +226,11 @@ char* gldns_wire2str_rcode(int rcode)
{
char buf[16];
gldns_wire2str_rcode_buf(rcode, buf, sizeof(buf));
#ifndef USE_WINSOCK
return strdup(buf);
#else
return _strdup(buf);
#endif
}
int gldns_wire2str_pkt_buf(uint8_t* d, size_t dlen, char* s, size_t slen)