Ver código fonte

convert to zalloc

tags/v0.9.3
Holger Lubitz 18 anos atrás
pai
commit
32e4ca8ae3
1 arquivos alterados com 1 adições e 2 exclusões
  1. 1
    2
      src/net/netdevice.c

+ 1
- 2
src/net/netdevice.c Ver arquivo

265
 	size_t total_len;
265
 	size_t total_len;
266
 
266
 
267
 	total_len = ( sizeof ( *netdev ) + priv_size );
267
 	total_len = ( sizeof ( *netdev ) + priv_size );
268
-	netdev = malloc ( total_len );
268
+	netdev = zalloc ( total_len );
269
 	if ( netdev ) {
269
 	if ( netdev ) {
270
-		memset ( netdev, 0, total_len );
271
 		netdev->refcnt.free = free_netdev;
270
 		netdev->refcnt.free = free_netdev;
272
 		INIT_LIST_HEAD ( &netdev->tx_queue );
271
 		INIT_LIST_HEAD ( &netdev->tx_queue );
273
 		INIT_LIST_HEAD ( &netdev->rx_queue );
272
 		INIT_LIST_HEAD ( &netdev->rx_queue );

Carregando…
Cancelar
Salvar