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