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