Преглед изворни кода

convert to zalloc

tags/v0.9.3
Holger Lubitz пре 18 година
родитељ
комит
7fa85d19b9
1 измењених фајлова са 1 додато и 2 уклоњено
  1. 1
    2
      src/net/tcp/ftp.c

+ 1
- 2
src/net/tcp/ftp.c Прегледај датотеку

426
 		return -EINVAL;
426
 		return -EINVAL;
427
 
427
 
428
 	/* Allocate and populate structure */
428
 	/* Allocate and populate structure */
429
-	ftp = malloc ( sizeof ( *ftp ) );
429
+	ftp = zalloc ( sizeof ( *ftp ) );
430
 	if ( ! ftp )
430
 	if ( ! ftp )
431
 		return -ENOMEM;
431
 		return -ENOMEM;
432
-	memset ( ftp, 0, sizeof ( *ftp ) );
433
 	ftp->refcnt.free = ftp_free;
432
 	ftp->refcnt.free = ftp_free;
434
 	xfer_init ( &ftp->xfer, &ftp_xfer_operations, &ftp->refcnt );
433
 	xfer_init ( &ftp->xfer, &ftp_xfer_operations, &ftp->refcnt );
435
 	ftp->uri = uri_get ( uri );
434
 	ftp->uri = uri_get ( uri );

Loading…
Откажи
Сачувај