use calloc for new_interface_server

malloc left garbage in the structure, dns IPs were filled with random content
pull/14342/head
Johannes Stratmann 2021-02-24 20:50:29 +01:00
parent 737153bcc1
commit 54b3b03426
1 changed files with 1 additions and 1 deletions

View File

@ -431,7 +431,7 @@ dns_add_interface_server(u8_t numdns, const char *interface_name, const ip_addr_
}
}
// add new dns server to the list tail
new_interface_server = mem_malloc(sizeof(struct dns_server_interface));
new_interface_server = mem_calloc(1, sizeof(struct dns_server_interface));
snprintf(new_interface_server->interface_name, INTERFACE_NAME_MAX_SIZE, "%s",interface_name);
new_interface_server->dns_servers[numdns] = (*dnsserver);
new_interface_server->next = NULL;