2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Add and use semantic patch to replace isc_mem_get/allocate+memset

Add new semantic patch to replace the straightfoward uses of:

  ptr = isc_mem_{get,allocate}(..., size);
  memset(ptr, 0, size);

with the new API call:

  ptr = isc_mem_{get,allocate}x(..., size, ISC_MEM_ZERO);
This commit is contained in:
Ondřej Surý
2022-06-03 12:36:24 +02:00
parent dbf5672f32
commit c1d26b53eb
40 changed files with 124 additions and 172 deletions

View File

@@ -2810,8 +2810,8 @@ update_action(isc_task_t *task, isc_event_t *event) {
*/
if (ssutable != NULL) {
ruleslen = request->counts[DNS_SECTION_UPDATE];
rules = isc_mem_get(mctx, sizeof(*rules) * ruleslen);
memset(rules, 0, sizeof(*rules) * ruleslen);
rules = isc_mem_getx(mctx, sizeof(*rules) * ruleslen,
ISC_MEM_ZERO);
}
for (rule = 0,