Handle the uninitialized memory error the brutal way

Because clang (or valgrind with clang) is just wrong here
This commit is contained in:
Willem Toorop 2017-11-28 16:51:28 +01:00
parent 72eb8628d0
commit 2a39b6e2e8
1 changed files with 1 additions and 0 deletions

View File

@ -866,6 +866,7 @@ _getdns_dns_req_new(getdns_context *context, getdns_eventloop *loop,
if (! (region = GETDNS_XMALLOC(context->mf, uint8_t, if (! (region = GETDNS_XMALLOC(context->mf, uint8_t,
dnsreq_base_sz + (a_aaaa_query ? 2 : 1) * netreq_sz))) dnsreq_base_sz + (a_aaaa_query ? 2 : 1) * netreq_sz)))
return NULL; return NULL;
(void) memset(region, 0, sizeof(getdns_dns_req));
result = (getdns_dns_req *)region; result = (getdns_dns_req *)region;
result->netreqs[0] = (getdns_network_req *)(region + dnsreq_base_sz); result->netreqs[0] = (getdns_network_req *)(region + dnsreq_base_sz);