Fix segmentation fault when removing 'Device.DNS.Relay.Forwarding.' object

This commit is contained in:
Amin Ben Ramdhane 2019-03-29 10:21:54 +01:00
parent fc9b46ab93
commit dc6b3d257e

View file

@ -403,11 +403,11 @@ int delete_relay_forwarding(char *refparam, struct dmctx *ctx, void *data, char
switch (del_action) {
case DEL_INST:
dmuci_get_value_by_section_string((struct uci_section *)data, "peerdns", str);
dmuci_get_value_by_section_string((struct uci_section *)data, "peerdns", &str);
if (str[0] == '1')
return 0;
dmuci_get_value_by_section_string((struct uci_section *)data, "interface", interface);
dmuci_get_value_by_section_string((struct uci_section *)data, "ip", ip);
dmuci_get_value_by_section_string((struct uci_section *)data, "interface", &interface);
dmuci_get_value_by_section_string((struct uci_section *)data, "ip", &ip);
dmuci_del_list_value("network", interface, "dns", ip);
dmuci_delete_by_section((struct uci_section *)data, NULL, NULL);
break;