networkd-dhcp6: Set initial value of route to NULL

Start with route set to NULL should there be no route created. Remove
the explicit route_free as the _cleanup_ will take care of that after
the continue;.
This commit is contained in:
Patrik Flykt 2018-09-25 18:09:17 -06:00 committed by Zbigniew Jędrzejewski-Szmek
parent 0fbc35524c
commit dd5ab7d913

View file

@ -134,7 +134,7 @@ int dhcp6_lease_pd_prefix_lost(sd_dhcp6_client *client, Link* link) {
&lifetime_preferred,
&lifetime_valid) >= 0) {
_cleanup_free_ char *buf = NULL;
_cleanup_free_ Route *route;
_cleanup_free_ Route *route = NULL;
if (pd_prefix_len > 64)
continue;
@ -163,7 +163,7 @@ int dhcp6_lease_pd_prefix_lost(sd_dhcp6_client *client, Link* link) {
log_link_warning_errno(link, r, "Cannot delete unreachable route for DHCPv6 delegated subnet %s/%u: %m",
strnull(buf),
pd_prefix_len);
route_free(route);
continue;
}
link = link_ref(link);