sd-dhcp6: fix crash by unrefing event sources before re-adding them
authorBenjamin Berg <bberg@redhat.com>
Thu, 15 Nov 2018 22:09:43 +0000 (07:09 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Nov 2018 13:57:42 +0000 (22:57 +0900)
commita5f07d2a16912a4c7151ab262aa43941f519926d
treeb7b5d6f987a84213fa74186e24f9fe3814e637ef
parenta3fa4287f5c1273ede6735979262da1f70db82ff
sd-dhcp6: fix crash by unrefing event sources before re-adding them

In certain cases the timeouts may not have been unref'ed before they
need to be re-added. Add the appropriate unref calls to ensure we don't
register the timeout multiple times.

This fixes possible cases where timeouts are triggered multiple times
and even on destroyed DHCPv6 clients.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/73

Fixes #10749.
src/libsystemd-network/sd-dhcp6-client.c