mirror of https://github.com/ipxe/ipxe.git
convert to zalloc
parent
2b9fb513f4
commit
da3c785816
|
@ -635,10 +635,9 @@ int tftp_open ( struct xfer_interface *xfer, struct uri *uri ) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Allocate and populate TFTP structure */
|
/* Allocate and populate TFTP structure */
|
||||||
tftp = malloc ( sizeof ( *tftp ) );
|
tftp = zalloc ( sizeof ( *tftp ) );
|
||||||
if ( ! tftp )
|
if ( ! tftp )
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
memset ( tftp, 0, sizeof ( *tftp ) );
|
|
||||||
tftp->refcnt.free = tftp_free;
|
tftp->refcnt.free = tftp_free;
|
||||||
xfer_init ( &tftp->xfer, &tftp_xfer_operations, &tftp->refcnt );
|
xfer_init ( &tftp->xfer, &tftp_xfer_operations, &tftp->refcnt );
|
||||||
tftp->uri = uri_get ( uri );
|
tftp->uri = uri_get ( uri );
|
||||||
|
|
Loading…
Reference in New Issue