mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Use designated initializers instead of memset()/MEM_ZERO for structs
In several places, the structures were cleaned with memset(...)) and thus the semantic patch converted the isc_mem_get(...) to isc_mem_getx(..., ISC_MEM_ZERO). Use the designated initializer to initialized the structures instead of zeroing the memory with ISC_MEM_ZERO flag as this better matches the intended purpose.
This commit is contained in:
@@ -933,13 +933,12 @@ make_log_buf(dns_rrl_t *rrl, dns_rrl_entry_t *e, const char *str1,
|
||||
if (qbuf != NULL) {
|
||||
ISC_LIST_UNLINK(rrl->qname_free, qbuf, link);
|
||||
} else if (rrl->num_qnames < DNS_RRL_QNAMES) {
|
||||
qbuf = isc_mem_getx(rrl->mctx, sizeof(*qbuf),
|
||||
ISC_MEM_ZERO);
|
||||
{
|
||||
ISC_LINK_INIT(qbuf, link);
|
||||
qbuf->index = rrl->num_qnames;
|
||||
rrl->qnames[rrl->num_qnames++] = qbuf;
|
||||
}
|
||||
qbuf = isc_mem_get(rrl->mctx, sizeof(*qbuf));
|
||||
*qbuf = (dns_rrl_qname_buf_t){
|
||||
.index = rrl->num_qnames,
|
||||
};
|
||||
ISC_LINK_INIT(qbuf, link);
|
||||
rrl->qnames[rrl->num_qnames++] = qbuf;
|
||||
}
|
||||
if (qbuf != NULL) {
|
||||
e->log_qname = qbuf->index;
|
||||
|
Reference in New Issue
Block a user