]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
convert to zalloc
authorHolger Lubitz <hal@duncan.ol.sub.de>
Sun, 17 Jun 2007 23:25:10 +0000 (01:25 +0200)
committerHolger Lubitz <hal@duncan.ol.sub.de>
Fri, 6 Jul 2007 18:47:15 +0000 (20:47 +0200)
src/net/tcp.c

index ebfaaa4ae7119e237e75274678a00bf605386b84..a1b86462410b8f16cf0e236da9381ea7897c8c6c 100644 (file)
@@ -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 );