Browse Source

convert to zalloc

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

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

460
 	}
460
 	}
461
 
461
 
462
 	/* Allocate DNS structure */
462
 	/* Allocate DNS structure */
463
-	dns = malloc ( sizeof ( *dns ) );
463
+	dns = zalloc ( sizeof ( *dns ) );
464
 	if ( ! dns )
464
 	if ( ! dns )
465
 		return -ENOMEM;
465
 		return -ENOMEM;
466
-	memset ( dns, 0, sizeof ( *dns ) );
467
 	resolv_init ( &dns->resolv, &null_resolv_ops, &dns->refcnt );
466
 	resolv_init ( &dns->resolv, &null_resolv_ops, &dns->refcnt );
468
 	xfer_init ( &dns->socket, &dns_socket_operations, &dns->refcnt );
467
 	xfer_init ( &dns->socket, &dns_socket_operations, &dns->refcnt );
469
 	dns->timer.expired = dns_timer_expired;
468
 	dns->timer.expired = dns_timer_expired;

Loading…
Cancel
Save