Explorar el Código

dns_cache.c: fix compiler warnings
- warningâsr_sums[*].r_sum may be used uninitialized in this function [-Wuninitialized]
- warningâsr_sums[*].rr may be used uninitialized in this function [-Wuninitialized]

Ovidiu Sas hace 12 años
padre
commit
b3c8f92fe4
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      dns_cache.c

+ 1 - 0
dns_cache.c

@@ -2306,6 +2306,7 @@ inline static struct dns_rr* dns_srv_get_nxt_rr(struct dns_hash_entry* e,
 	servers_up = atomic_get(dns_servers_up);
 #endif
 
+	memset(r_sums, 0, sizeof(struct r_sums_entry) * MAX_SRV_GRP_IDX);
 	rand_w=0;
 	for(rr=e->rr_lst, n=0;rr && (n<*no);rr=rr->next, n++);/* skip *no records*/