mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 20:25:38 +03:00
networkd: dhcp - avoid null pointer dereference
This commit is contained in:
parent
1746cf2ad7
commit
b1b532f58c
@ -513,13 +513,17 @@ static void dhcp_handler(sd_dhcp_client *client, int event, void *userdata) {
|
||||
|
||||
if (event == DHCP_EVENT_IP_CHANGE || event == DHCP_EVENT_EXPIRED ||
|
||||
event == DHCP_EVENT_STOP) {
|
||||
address_drop(link->dhcp_address, link, address_drop_handler);
|
||||
if (link->dhcp_address) {
|
||||
address_drop(link->dhcp_address, link, address_drop_handler);
|
||||
|
||||
address_free(link->dhcp_address);
|
||||
link->dhcp_address = NULL;
|
||||
address_free(link->dhcp_address);
|
||||
link->dhcp_address = NULL;
|
||||
}
|
||||
|
||||
route_free(link->dhcp_route);
|
||||
link->dhcp_route = NULL;
|
||||
if (link->dhcp_route) {
|
||||
route_free(link->dhcp_route);
|
||||
link->dhcp_route = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
r = sd_dhcp_client_get_address(client, &address);
|
||||
|
Loading…
Reference in New Issue
Block a user