Browse Source

convert to zalloc

tags/v0.9.3
Holger Lubitz 17 years ago
parent
commit
a4d3476e0e
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      src/net/udp/dhcp.c

+ 1
- 2
src/net/udp/dhcp.c View File

787
 	int rc;
787
 	int rc;
788
 
788
 
789
 	/* Allocate and initialise structure */
789
 	/* Allocate and initialise structure */
790
-	dhcp = malloc ( sizeof ( *dhcp ) );
790
+	dhcp = zalloc ( sizeof ( *dhcp ) );
791
 	if ( ! dhcp )
791
 	if ( ! dhcp )
792
 		return -ENOMEM;
792
 		return -ENOMEM;
793
-	memset ( dhcp, 0, sizeof ( *dhcp ) );
794
 	dhcp->refcnt.free = dhcp_free;
793
 	dhcp->refcnt.free = dhcp_free;
795
 	job_init ( &dhcp->job, &dhcp_job_operations, &dhcp->refcnt );
794
 	job_init ( &dhcp->job, &dhcp_job_operations, &dhcp->refcnt );
796
 	xfer_init ( &dhcp->xfer, &dhcp_xfer_operations, &dhcp->refcnt );
795
 	xfer_init ( &dhcp->xfer, &dhcp_xfer_operations, &dhcp->refcnt );

Loading…
Cancel
Save