Преглед на файлове

convert to zalloc

tags/v0.9.3
Holger Lubitz преди 19 години
родител
ревизия
7872b890fe
променени са 1 файла, в които са добавени 1 реда и са изтрити 2 реда
  1. 1
    2
      src/net/tcp/http.c

+ 1
- 2
src/net/tcp/http.c Целия файл

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

Loading…
Отказ
Запис