From: Yu Watanabe Date: Fri, 2 Oct 2020 00:31:29 +0000 (+0900) Subject: network: make route_free() return NULL X-Git-Tag: v247-rc1~117^2~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=169948e9d27a91c7c0ea3a42d4ccac3838ef75cd;p=thirdparty%2Fsystemd.git network: make route_free() return NULL --- diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 98370a94407..0236ac32626 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -128,9 +128,9 @@ static int route_new_static(Network *network, const char *filename, unsigned sec return 0; } -void route_free(Route *route) { +Route *route_free(Route *route) { if (!route) - return; + return NULL; if (route->network) { LIST_REMOVE(routes, route->network->static_routes, route); @@ -164,7 +164,7 @@ void route_free(Route *route) { sd_event_source_unref(route->expire); - free(route); + return mfree(route); } void route_hash_func(const Route *route, struct siphash *state) { diff --git a/src/network/networkd-route.h b/src/network/networkd-route.h index cf637e67c24..bcd960e35f0 100644 --- a/src/network/networkd-route.h +++ b/src/network/networkd-route.h @@ -67,7 +67,7 @@ int route_compare_func(const Route *a, const Route *b); extern const struct hash_ops route_hash_ops; int route_new(Route **ret); -void route_free(Route *route); +Route *route_free(Route *route); int route_configure(Route *route, Link *link, link_netlink_message_handler_t callback, Route **ret); int route_remove(Route *route, Link *link, link_netlink_message_handler_t callback);