ui/ncurses: clear DNS server setting before appending new servers
[petitboot] / ui / ncurses / nc-config.c
index 64d0619b66c66703dc64c9d08c9b50e07dfc3903..f4fa073308e88c3246f30bd5357b433173bac05c 100644 (file)
@@ -249,6 +249,10 @@ static int screen_process_form(struct config_screen *screen)
        }
 
        str = widget_textbox_get_value(screen->widgets.dns_f);
        }
 
        str = widget_textbox_get_value(screen->widgets.dns_f);
+       talloc_free(config->network.dns_servers);
+       config->network.dns_servers = NULL;
+       config->network.n_dns_servers = 0;
+
        if (str && strlen(str)) {
                char *dns, *tmp;
                int i;
        if (str && strlen(str)) {
                char *dns, *tmp;
                int i;