瀏覽代碼

convert to zalloc

tags/v0.9.3
Holger Lubitz 17 年之前
父節點
當前提交
7872b890fe
共有 1 個檔案被更改,包括 1 行新增2 行删除
  1. 1
    2
      src/net/tcp/http.c

+ 1
- 2
src/net/tcp/http.c 查看文件

@@ -475,10 +475,9 @@ int http_open ( struct xfer_interface *xfer, struct uri *uri ) {
475 475
 		return -EINVAL;
476 476
 
477 477
 	/* Allocate and populate HTTP structure */
478
-	http = malloc ( sizeof ( *http ) );
478
+	http = zalloc ( sizeof ( *http ) );
479 479
 	if ( ! http )
480 480
 		return -ENOMEM;
481
-	memset ( http, 0, sizeof ( *http ) );
482 481
 	http->refcnt.free = http_free;
483 482
 	xfer_init ( &http->xfer, &http_xfer_operations, &http->refcnt );
484 483
        	http->uri = uri_get ( uri );

Loading…
取消
儲存