mirror of https://github.com/ipxe/ipxe.git
convert to zalloc
parent
389c63d7c4
commit
a4d3476e0e
|
@ -787,10 +787,9 @@ int start_dhcp ( struct job_interface *job, struct net_device *netdev,
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* Allocate and initialise structure */
|
/* Allocate and initialise structure */
|
||||||
dhcp = malloc ( sizeof ( *dhcp ) );
|
dhcp = zalloc ( sizeof ( *dhcp ) );
|
||||||
if ( ! dhcp )
|
if ( ! dhcp )
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
memset ( dhcp, 0, sizeof ( *dhcp ) );
|
|
||||||
dhcp->refcnt.free = dhcp_free;
|
dhcp->refcnt.free = dhcp_free;
|
||||||
job_init ( &dhcp->job, &dhcp_job_operations, &dhcp->refcnt );
|
job_init ( &dhcp->job, &dhcp_job_operations, &dhcp->refcnt );
|
||||||
xfer_init ( &dhcp->xfer, &dhcp_xfer_operations, &dhcp->refcnt );
|
xfer_init ( &dhcp->xfer, &dhcp_xfer_operations, &dhcp->refcnt );
|
||||||
|
|
Loading…
Reference in New Issue