void *data,
void *userdata) {
- Network *network = userdata;
+ Network *network = ASSERT_PTR(userdata);
_cleanup_(route_free_or_set_invalidp) Route *route = NULL;
int r;
assert(filename);
- assert(section);
- assert(lvalue);
assert(rvalue);
- assert(data);
r = route_new_static(network, filename, section_line, &route);
if (r == -ENOMEM)
r = config_parse_string(unit, filename, line, section, section_line, lvalue, 0,
rvalue, &route->metric.tcp_congestion_control_algo, userdata);
- if (r < 0)
+ if (r <= 0)
return r;
TAKE_PTR(route);
void *userdata) {
char **s = ASSERT_PTR(data);
+ int r;
assert(filename);
assert(lvalue);
if (isempty(rvalue)) {
*s = mfree(*s);
- return 0;
+ return 1;
}
if (FLAGS_SET(ltype, CONFIG_PARSE_STRING_SAFE) && !string_is_safe(rvalue)) {
return 0;
}
- return free_and_strdup_warn(s, empty_to_null(rvalue));
+ r = free_and_strdup_warn(s, empty_to_null(rvalue));
+ if (r < 0)
+ return r;
+
+ return 1;
}
int config_parse_dns_name(