network: route - use ordered_set_ensure_put

This commit is contained in:
Susant Sahani
2021-01-16 12:05:44 +00:00
committed by Luca Boccassi
parent ef1bd2349b
commit 8cb3465100
+2 -4
View File
@@ -2341,11 +2341,9 @@ int config_parse_multipath_route(
}
}
r = ordered_set_ensure_allocated(&n->multipath_routes, NULL);
if (r < 0)
r = ordered_set_ensure_put(&n->multipath_routes, NULL, m);
if (r == -ENOMEM)
return log_oom();
r = ordered_set_put(n->multipath_routes, m);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Failed to store multipath route, ignoring assignment: %m");