瀏覽代碼

convert to zalloc

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

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

@@ -261,10 +261,9 @@ int create_downloader ( struct job_interface *job, struct image *image,
261 261
 	int rc;
262 262
 
263 263
 	/* Allocate and initialise structure */
264
-	downloader = malloc ( sizeof ( *downloader ) );
264
+	downloader = zalloc ( sizeof ( *downloader ) );
265 265
 	if ( ! downloader )
266 266
 		return -ENOMEM;
267
-	memset ( downloader, 0, sizeof ( *downloader ) );
268 267
 	downloader->refcnt.free = downloader_free;
269 268
 	job_init ( &downloader->job, &downloader_job_operations,
270 269
 		   &downloader->refcnt );

Loading…
取消
儲存