|
@@ -205,11 +205,10 @@ static int tcp_open ( struct xfer_interface *xfer, struct sockaddr *peer,
|
205
|
205
|
int rc;
|
206
|
206
|
|
207
|
207
|
/* Allocate and initialise structure */
|
208
|
|
- tcp = malloc ( sizeof ( *tcp ) );
|
|
208
|
+ tcp = zalloc ( sizeof ( *tcp ) );
|
209
|
209
|
if ( ! tcp )
|
210
|
210
|
return -ENOMEM;
|
211
|
211
|
DBGC ( tcp, "TCP %p allocated\n", tcp );
|
212
|
|
- memset ( tcp, 0, sizeof ( *tcp ) );
|
213
|
212
|
xfer_init ( &tcp->xfer, &tcp_xfer_operations, &tcp->refcnt );
|
214
|
213
|
tcp->prev_tcp_state = TCP_CLOSED;
|
215
|
214
|
tcp->tcp_state = TCP_STATE_SENT ( TCP_SYN );
|