convert to zalloc
This commit is contained in:
parent
7fa85d19b9
commit
7872b890fe
|
@ -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