Procházet zdrojové kódy

convert to zalloc

tags/v0.9.3
Holger Lubitz před 18 roky
rodič
revize
da3c785816
1 změnil soubory, kde provedl 1 přidání a 2 odebrání
  1. 1
    2
      src/net/udp/tftp.c

+ 1
- 2
src/net/udp/tftp.c Zobrazit soubor

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

Načítá se…
Zrušit
Uložit