mirror of
https://github.com/ipxe/ipxe
synced 2025-12-13 23:41:45 +03:00
convert to zalloc
This commit is contained in:
@@ -205,11 +205,10 @@ static int tcp_open ( struct xfer_interface *xfer, struct sockaddr *peer,
|
|||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* Allocate and initialise structure */
|
/* Allocate and initialise structure */
|
||||||
tcp = malloc ( sizeof ( *tcp ) );
|
tcp = zalloc ( sizeof ( *tcp ) );
|
||||||
if ( ! tcp )
|
if ( ! tcp )
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
DBGC ( tcp, "TCP %p allocated\n", tcp );
|
DBGC ( tcp, "TCP %p allocated\n", tcp );
|
||||||
memset ( tcp, 0, sizeof ( *tcp ) );
|
|
||||||
xfer_init ( &tcp->xfer, &tcp_xfer_operations, &tcp->refcnt );
|
xfer_init ( &tcp->xfer, &tcp_xfer_operations, &tcp->refcnt );
|
||||||
tcp->prev_tcp_state = TCP_CLOSED;
|
tcp->prev_tcp_state = TCP_CLOSED;
|
||||||
tcp->tcp_state = TCP_STATE_SENT ( TCP_SYN );
|
tcp->tcp_state = TCP_STATE_SENT ( TCP_SYN );
|
||||||
|
|||||||
Reference in New Issue
Block a user