network/json: fix error handling
This commit is contained in:
@@ -1420,13 +1420,12 @@ static int dhcp_client_private_options_append_json(Link *link, sd_json_variant *
|
||||
return 0;
|
||||
|
||||
LIST_FOREACH(options, option, link->dhcp_lease->private_options) {
|
||||
|
||||
r = sd_json_variant_append_arraybo(
|
||||
&array,
|
||||
SD_JSON_BUILD_PAIR_UNSIGNED("Option", option->tag),
|
||||
SD_JSON_BUILD_PAIR_HEX("PrivateOptionData", option->data, option->length));
|
||||
if (r < 0)
|
||||
return 0;
|
||||
return r;
|
||||
}
|
||||
return json_variant_set_field_non_null(v, "PrivateOptions", array);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user