Pārlūkot izejas kodu

convert to zalloc

tags/v0.9.3
Holger Lubitz 17 gadus atpakaļ
vecāks
revīzija
2b9fb513f4
1 mainītis faili ar 1 papildinājumiem un 2 dzēšanām
  1. 1
    2
      src/net/udp/dns.c

+ 1
- 2
src/net/udp/dns.c Parādīt failu

@@ -460,10 +460,9 @@ static int dns_resolv ( struct resolv_interface *resolv,
460 460
 	}
461 461
 
462 462
 	/* Allocate DNS structure */
463
-	dns = malloc ( sizeof ( *dns ) );
463
+	dns = zalloc ( sizeof ( *dns ) );
464 464
 	if ( ! dns )
465 465
 		return -ENOMEM;
466
-	memset ( dns, 0, sizeof ( *dns ) );
467 466
 	resolv_init ( &dns->resolv, &null_resolv_ops, &dns->refcnt );
468 467
 	xfer_init ( &dns->socket, &dns_socket_operations, &dns->refcnt );
469 468
 	dns->timer.expired = dns_timer_expired;

Notiek ielāde…
Atcelt
Saglabāt