mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 05:21:49 +03:00
convert to zalloc
This commit is contained in:
@@ -475,10 +475,9 @@ int http_open ( struct xfer_interface *xfer, struct uri *uri ) {
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Allocate and populate HTTP structure */
|
/* Allocate and populate HTTP structure */
|
||||||
http = malloc ( sizeof ( *http ) );
|
http = zalloc ( sizeof ( *http ) );
|
||||||
if ( ! http )
|
if ( ! http )
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
memset ( http, 0, sizeof ( *http ) );
|
|
||||||
http->refcnt.free = http_free;
|
http->refcnt.free = http_free;
|
||||||
xfer_init ( &http->xfer, &http_xfer_operations, &http->refcnt );
|
xfer_init ( &http->xfer, &http_xfer_operations, &http->refcnt );
|
||||||
http->uri = uri_get ( uri );
|
http->uri = uri_get ( uri );
|
||||||
|
|||||||
Reference in New Issue
Block a user