david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[dns] Fix memory leak in settings applicator

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2011-03-03 20:09:29 +00:00
parent 48a4001152
commit bbe265e08b
1 changed files with 9 additions and 2 deletions

View File

@ -612,16 +612,23 @@ static int apply_dns_settings ( void ) {
( struct sockaddr_in * ) &nameserver;
int len;
/* Fetch DNS server address */
nameserver.st_family = 0;
if ( ( len = fetch_ipv4_setting ( NULL, &dns_setting,
&sin_nameserver->sin_addr ) ) >= 0 ){
sin_nameserver->sin_family = AF_INET;
nameserver.st_family = AF_INET;
DBG ( "DNS using nameserver %s\n",
inet_ntoa ( sin_nameserver->sin_addr ) );
}
/* Get local domain DHCP option */
free ( localdomain );
if ( ( len = fetch_string_setting_copy ( NULL, &domain_setting,
&localdomain ) ) >= 0 )
&localdomain ) ) < 0 ) {
DBG ( "DNS could not fetch local domain: %s\n",
strerror ( len ) );
}
if ( localdomain )
DBG ( "DNS local domain %s\n", localdomain );
return 0;