| Written-by: Tomas Mraz <tmraz@redhat.com> |
| Reviewed-by: Adam Tkac <atkac@redhat.com> |
| |
| diff -up bind-9.5.0a6/lib/dns/resolver.c.badfree bind-9.5.0a6/lib/dns/resolver.c |
| |
| |
| @@ -7455,17 +7455,17 @@ dns_resolver_createdispatchpool(dns_reso |
| return (result); |
| |
| cleanup: |
| - for (i = 0; i < ndisps; i++) { |
| - if (res->dispatchv4pool[i] != NULL) |
| - dns_dispatch_detach(&res->dispatchv4pool[i]); |
| - if (res->dispatchv6pool[i] != NULL) |
| - dns_dispatch_detach(&res->dispatchv6pool[i]); |
| - } |
| if (res->dispatchv4pool != NULL) { |
| + for (i = 0; i < ndisps; i++) |
| + if (res->dispatchv4pool[i] != NULL) |
| + dns_dispatch_detach(&res->dispatchv4pool[i]); |
| isc_mem_put(res->mctx, res->dispatchv4pool, |
| sizeof(dns_dispatch_t *) * ndisps); |
| } |
| if (res->dispatchv6pool != NULL) { |
| + for (i = 0; i < ndisps; i++) |
| + if (res->dispatchv6pool[i] != NULL) |
| + dns_dispatch_detach(&res->dispatchv6pool[i]); |
| isc_mem_put(res->mctx, res->dispatchv6pool, |
| sizeof(dns_dispatch_t *) * ndisps); |
| } |