1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

network: dhcp4: use free_and_strdup_warn()

This commit is contained in:
Yu Watanabe 2021-09-08 13:50:59 +09:00
parent ec84bb2a2b
commit 471e332d50

View File

@ -984,11 +984,9 @@ static int dhcp4_request_address(Link *link, bool announce) {
addr->route_metric = link->network->dhcp_route_metric;
addr->duplicate_address_detection = link->network->dhcp_send_decline ? ADDRESS_FAMILY_IPV4 : ADDRESS_FAMILY_NO;
if (link->network->dhcp_label) {
addr->label = strdup(link->network->dhcp_label);
if (!addr->label)
return log_oom();
}
r = free_and_strdup_warn(&addr->label, link->network->dhcp_label);
if (r < 0)
return r;
if (address_get(link, addr, NULL) < 0)
link->dhcp4_configured = false;