Holger Lubitz 19 лет назад
Родитель
Сommit
389c63d7c4
1 измененных файлов: 1 добавлений и 2 удалений
  1. 1
    2
      src/net/udp.c

+ 1
- 2
src/net/udp.c Просмотреть файл

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
 

Загрузка…
Отмена
Сохранить