route->lifetime = USEC_INFINITY;
route->quickack = -1;
- *ret = route;
- route = NULL;
+ *ret = TAKE_PTR(route);
return 0;
}
route = hashmap_get(network->routes_by_section, n);
if (route) {
- *ret = route;
- route = NULL;
+ *ret = TAKE_PTR(route);
return 0;
}
route->protocol = RTPROT_STATIC;
if (filename) {
- route->section = n;
- n = NULL;
+ route->section = TAKE_PTR(n);
r = hashmap_put(network->routes_by_section, route->section, route);
if (r < 0)
LIST_PREPEND(routes, network->static_routes, route);
network->n_static_routes++;
- *ret = route;
- route = NULL;
+ *ret = TAKE_PTR(route);
return 0;
}
}
sd_event_source_unref(route->expire);
- route->expire = expire;
- expire = NULL;
+ route->expire = TAKE_PTR(expire);
return 0;
}