Skip to content

Commit 54b3b03

Browse files
committed
use calloc for new_interface_server
malloc left garbage in the structure, dns IPs were filled with random content
1 parent 737153b commit 54b3b03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

connectivity/lwipstack/lwip/src/core/lwip_dns.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ dns_add_interface_server(u8_t numdns, const char *interface_name, const ip_addr_
431431
}
432432
}
433433
// add new dns server to the list tail
434-
new_interface_server = mem_malloc(sizeof(struct dns_server_interface));
434+
new_interface_server = mem_calloc(1, sizeof(struct dns_server_interface));
435435
snprintf(new_interface_server->interface_name, INTERFACE_NAME_MAX_SIZE, "%s",interface_name);
436436
new_interface_server->dns_servers[numdns] = (*dnsserver);
437437
new_interface_server->next = NULL;

0 commit comments

Comments
 (0)