Browse Source

convert to zalloc

tags/v0.9.3
Holger Lubitz 17 years ago
parent
commit
da3c785816
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      src/net/udp/tftp.c

+ 1
- 2
src/net/udp/tftp.c View File

635
 		return -EINVAL;
635
 		return -EINVAL;
636
 
636
 
637
 	/* Allocate and populate TFTP structure */
637
 	/* Allocate and populate TFTP structure */
638
-	tftp = malloc ( sizeof ( *tftp ) );
638
+	tftp = zalloc ( sizeof ( *tftp ) );
639
 	if ( ! tftp )
639
 	if ( ! tftp )
640
 		return -ENOMEM;
640
 		return -ENOMEM;
641
-	memset ( tftp, 0, sizeof ( *tftp ) );
642
 	tftp->refcnt.free = tftp_free;
641
 	tftp->refcnt.free = tftp_free;
643
 	xfer_init ( &tftp->xfer, &tftp_xfer_operations, &tftp->refcnt );
642
 	xfer_init ( &tftp->xfer, &tftp_xfer_operations, &tftp->refcnt );
644
 	tftp->uri = uri_get ( uri );
643
 	tftp->uri = uri_get ( uri );

Loading…
Cancel
Save