mirror of
https://github.com/ipxe/ipxe
synced 2026-02-28 03:11:18 +03:00
convert to zalloc
This commit is contained in:
@@ -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 );
|
||||||
|
|||||||
Reference in New Issue
Block a user