Parcourir la source

convert to zalloc

tags/v0.9.3
Holger Lubitz il y a 18 ans
Parent
révision
da3c785816
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1
    2
      src/net/udp/tftp.c

+ 1
- 2
src/net/udp/tftp.c Voir le fichier

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 );

Chargement…
Annuler
Enregistrer