From: Patrik Flykt Date: Wed, 26 Sep 2018 00:09:17 +0000 (-0600) Subject: networkd-dhcp6: Set initial value of route to NULL X-Git-Tag: v240~682 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd5ab7d9136a0548d351bc2291ad07a95757a8e4;p=platform%2Fupstream%2Fsystemd.git 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;. --- diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index 518d3e8..df6bbcb 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -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);