mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 05:40:15 +01:00
dhcp: fix startup warnings with dhcp=internal
If asked to read a file that doesn't exist, sd_dhcp_lease_load() returns 0 (success) without setting the out lease argument. So we need to check both the return status and the lease before proceeding.
This commit is contained in:
parent
71b676590c
commit
7bf7ebc470
1 changed files with 1 additions and 1 deletions
|
|
@ -390,7 +390,7 @@ nm_dhcp_systemd_get_lease_ip_configs (const char *iface,
|
|||
|
||||
path = get_leasefile_path (iface, uuid, FALSE);
|
||||
r = sd_dhcp_lease_load (&lease, path);
|
||||
if (r == 0) {
|
||||
if (r == 0 && lease) {
|
||||
ip4_config = lease_to_ip4_config (lease, NULL, 0, FALSE, NULL);
|
||||
if (ip4_config)
|
||||
leases = g_slist_append (leases, ip4_config);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue