Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[dns] Fix memory leak in settings applicator
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 3, 2011
1 parent 48a4001 commit bbe265e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/net/udp/dns.c
Expand Up @@ -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;
Expand Down

0 comments on commit bbe265e

Please sign in to comment.