瀏覽代碼

convert to zalloc

tags/v0.9.3
Holger Lubitz 18 年之前
父節點
當前提交
f77d9469a4
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1
    2
      src/core/posix_io.c

+ 1
- 2
src/core/posix_io.c 查看文件

215
 		return fd;
215
 		return fd;
216
 
216
 
217
 	/* Allocate and initialise structure */
217
 	/* Allocate and initialise structure */
218
-	file = malloc ( sizeof ( *file ) );
218
+	file = zalloc ( sizeof ( *file ) );
219
 	if ( ! file )
219
 	if ( ! file )
220
 		return -ENOMEM;
220
 		return -ENOMEM;
221
-	memset ( file, 0, sizeof ( *file ) );
222
 	file->refcnt.free = posix_file_free;
221
 	file->refcnt.free = posix_file_free;
223
 	file->fd = fd;
222
 	file->fd = fd;
224
 	file->rc = -EINPROGRESS;
223
 	file->rc = -EINPROGRESS;

Loading…
取消
儲存