mirror of
https://github.com/ipxe/ipxe
synced 2025-12-15 17:12:54 +03:00
convert to zalloc
This commit is contained in:
@@ -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 ) );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user