소스 검색

convert to zalloc

tags/v0.9.3
Holger Lubitz 19 년 전
부모
커밋
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…
취소
저장