1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-30 05:49:54 +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->route_metric = link->network->dhcp_route_metric;
addr->duplicate_address_detection = link->network->dhcp_send_decline ? ADDRESS_FAMILY_IPV4 : ADDRESS_FAMILY_NO; addr->duplicate_address_detection = link->network->dhcp_send_decline ? ADDRESS_FAMILY_IPV4 : ADDRESS_FAMILY_NO;
if (link->network->dhcp_label) { r = free_and_strdup_warn(&addr->label, link->network->dhcp_label);
addr->label = strdup(link->network->dhcp_label); if (r < 0)
if (!addr->label) return r;
return log_oom();
}
if (address_get(link, addr, NULL) < 0) if (address_get(link, addr, NULL) < 0)
link->dhcp4_configured = false; link->dhcp4_configured = false;