1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-30 05:49:54 +03:00

networkd: don't clear dhcpv6 lease timers if there's no previous lease

If client->lease is NULL, dhcp6_lease_clear_timers will cause a segmentation
fault.
This commit is contained in:
Steven Noonan
2014-07-03 19:43:56 -07:00
committed by Tom Gundersen
parent 4d9f07b492
commit b1e1238fb3

View File

@ -708,7 +708,8 @@ static int client_receive_reply(sd_dhcp6_client *client, DHCP6Message *reply,
return 0; return 0;
} }
dhcp6_lease_clear_timers(&client->lease->ia); if (client->lease)
dhcp6_lease_clear_timers(&client->lease->ia);
client->lease = sd_dhcp6_lease_unref(client->lease); client->lease = sd_dhcp6_lease_unref(client->lease);
client->lease = lease; client->lease = lease;