summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2014-07-03 19:43:56 -0700
committerTom Gundersen <teg@jklm.no>2014-07-04 11:34:43 +0200
commitb1e1238fb3af77419eca704fb64f68a313954734 (patch)
tree1ee68cb9307d7fb018eb9c3d9f5b1c1e4d9cc68e /src
parent4d9f07b492ba1707d4a92cd937b87b8baf827f7d (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-network/sd-dhcp6-client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
index 8fdbbfe320..a83778e938 100644
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -708,7 +708,8 @@ static int client_receive_reply(sd_dhcp6_client *client, DHCP6Message *reply,
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 = lease;