convert to zalloc
This commit is contained in:
parent
6d0332b5b3
commit
aca232c973
@ -56,10 +56,9 @@ static int hw_open ( struct xfer_interface *xfer, struct uri *uri __unused ) {
|
|||||||
struct hw *hw;
|
struct hw *hw;
|
||||||
|
|
||||||
/* Allocate and initialise structure */
|
/* Allocate and initialise structure */
|
||||||
hw = malloc ( sizeof ( *hw ) );
|
hw = zalloc ( sizeof ( *hw ) );
|
||||||
if ( ! hw )
|
if ( ! hw )
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
memset ( hw, 0, sizeof ( *hw ) );
|
|
||||||
xfer_init ( &hw->xfer, &hw_xfer_operations, &hw->refcnt );
|
xfer_init ( &hw->xfer, &hw_xfer_operations, &hw->refcnt );
|
||||||
process_init ( &hw->process, hw_step, &hw->refcnt );
|
process_init ( &hw->process, hw_step, &hw->refcnt );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user