mirror of https://github.com/ipxe/ipxe.git
convert to zalloc
parent
32e4ca8ae3
commit
389c63d7c4
|
@ -104,11 +104,10 @@ static int udp_open_common ( struct xfer_interface *xfer,
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* Allocate and initialise structure */
|
/* Allocate and initialise structure */
|
||||||
udp = malloc ( sizeof ( *udp ) );
|
udp = zalloc ( sizeof ( *udp ) );
|
||||||
if ( ! udp )
|
if ( ! udp )
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
DBGC ( udp, "UDP %p allocated\n", udp );
|
DBGC ( udp, "UDP %p allocated\n", udp );
|
||||||
memset ( udp, 0, sizeof ( *udp ) );
|
|
||||||
xfer_init ( &udp->xfer, &udp_xfer_operations, &udp->refcnt );
|
xfer_init ( &udp->xfer, &udp_xfer_operations, &udp->refcnt );
|
||||||
memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) );
|
memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue