]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: make route_free() return NULL
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 2 Oct 2020 00:31:29 +0000 (09:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 Oct 2020 17:44:42 +0000 (02:44 +0900)
src/network/networkd-route.c
src/network/networkd-route.h

index 98370a944071fcf520d84e0409e42723091e50e6..0236ac3262610338941318ffd1716b037e0626dd 100644 (file)
@@ -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) {
index cf637e67c242a1610c42e4f3de3b3a24c1c9a79d..bcd960e35f0c8a3bdd06d4a03f5eff7ff8ba51ba 100644 (file)
@@ -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);