浏览代码

convert to zalloc

tags/v0.9.3
Holger Lubitz 18 年前
父节点
当前提交
da3c785816
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1
    2
      src/net/udp/tftp.c

+ 1
- 2
src/net/udp/tftp.c 查看文件

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

正在加载...
取消
保存