From: Holger Lubitz Date: Sun, 17 Jun 2007 23:25:10 +0000 (+0200) Subject: convert to zalloc X-Git-Tag: v0.9.3~265 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc6c1c294d130a150fab65073a22ae189d4d6d57;p=thirdparty%2Fipxe.git convert to zalloc --- diff --git a/src/net/tcp.c b/src/net/tcp.c index ebfaaa4ae..a1b864624 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -205,11 +205,10 @@ static int tcp_open ( struct xfer_interface *xfer, struct sockaddr *peer, int rc; /* Allocate and initialise structure */ - tcp = malloc ( sizeof ( *tcp ) ); + tcp = zalloc ( sizeof ( *tcp ) ); if ( ! tcp ) return -ENOMEM; DBGC ( tcp, "TCP %p allocated\n", tcp ); - memset ( tcp, 0, sizeof ( *tcp ) ); xfer_init ( &tcp->xfer, &tcp_xfer_operations, &tcp->refcnt ); tcp->prev_tcp_state = TCP_CLOSED; tcp->tcp_state = TCP_STATE_SENT ( TCP_SYN );