Explorar el Código

convert to zalloc

tags/v0.9.3
Holger Lubitz hace 17 años
padre
commit
2b9fb513f4
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1
    2
      src/net/udp/dns.c

+ 1
- 2
src/net/udp/dns.c Ver fichero

@@ -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;

Loading…
Cancelar
Guardar