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:
@ -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;
|
||||||
|
Reference in New Issue
Block a user