Browse Source

convert to zalloc

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

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

104
 	int rc;
104
 	int rc;
105
 
105
 
106
 	/* Allocate and initialise structure */
106
 	/* Allocate and initialise structure */
107
-	udp = malloc ( sizeof ( *udp ) );
107
+	udp = zalloc ( sizeof ( *udp ) );
108
 	if ( ! udp )
108
 	if ( ! udp )
109
 		return -ENOMEM;
109
 		return -ENOMEM;
110
 	DBGC ( udp, "UDP %p allocated\n", udp );
110
 	DBGC ( udp, "UDP %p allocated\n", udp );
111
-	memset ( udp, 0, sizeof ( *udp ) );
112
 	xfer_init ( &udp->xfer, &udp_xfer_operations, &udp->refcnt );
111
 	xfer_init ( &udp->xfer, &udp_xfer_operations, &udp->refcnt );
113
 	memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) );
112
 	memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) );
114
 
113
 

Loading…
Cancel
Save