convert to zalloc
This commit is contained in:
parent
7872b890fe
commit
2b9fb513f4
|
@ -460,10 +460,9 @@ static int dns_resolv ( struct resolv_interface *resolv,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate DNS structure */
|
/* Allocate DNS structure */
|
||||||
dns = malloc ( sizeof ( *dns ) );
|
dns = zalloc ( sizeof ( *dns ) );
|
||||||
if ( ! dns )
|
if ( ! dns )
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
memset ( dns, 0, sizeof ( *dns ) );
|
|
||||||
resolv_init ( &dns->resolv, &null_resolv_ops, &dns->refcnt );
|
resolv_init ( &dns->resolv, &null_resolv_ops, &dns->refcnt );
|
||||||
xfer_init ( &dns->socket, &dns_socket_operations, &dns->refcnt );
|
xfer_init ( &dns->socket, &dns_socket_operations, &dns->refcnt );
|
||||||
dns->timer.expired = dns_timer_expired;
|
dns->timer.expired = dns_timer_expired;
|
||||||
|
|
Reference in New Issue