if (node->children != NULL) {
children = json_array();
- if (children == NULL) {
- pr_op_err("json array allocation failure.");
- return NULL;
- }
+ if (children == NULL)
+ enomem_panic();
if (json_object_set_new(json, TAGNAME_CHILDREN, children)) {
pr_op_err("Cannot push children array into json node; unknown cause.");
jchild = node2json(child);
if (jchild == NULL)
goto cancel; /* Error msg already printed */
- if (json_array_append(children, jchild)) {
+ if (json_array_append_new(children, jchild)) {
pr_op_err("Cannot push child into json node; unknown cause.");
goto cancel;
}
child = node2json(node);
if (child == NULL)
return -1;
- if (json_array_append(root, child)) {
+ if (json_array_append_new(root, child)) {
pr_op_err("Cannot push %s json node into json root; unknown cause.",
name);
return -1;
return;
if (get_metadata_json_filename(cache->tal, &filename) != 0)
- return;
+ goto end;
if (json_dump_file(json, filename, JSON_COMPACT))
pr_op_err("Unable to write metadata.json; unknown cause.");
free(filename);
- json_decref(json);
+end: json_decref(json);
}
struct rpki_cache *
.name = "http.max-redirs",
.type = >_uint,
.offset = offsetof(struct rpki_config, http.max_redirs),
- .doc = "Maximum number of redirections to follow, per request.",
+ .doc = "Maximum number of redirections to follow, per HTTP request.",
.min = 0,
.max = UINT_MAX,
}, {
if (error)
return error;
+ memset(&tm, 0, sizeof(tm));
consumed = strptime(str, "%FT%T%z", &tm);
if (consumed == NULL || (*consumed) != 0)
return pr_op_err("String '%s' does not appear to be a timestamp.",
if (strcmp(config_args->array[i], "$REMOTE") == 0)
copy_args[i + 1] = pstrdup(uri_get_global(uri));
else if (strcmp(config_args->array[i], "$LOCAL") == 0)
- copy_args[i + 1] = pstrdup(get_target(uri));
+ copy_args[i + 1] = get_target(uri);
else
copy_args[i + 1] = pstrdup(config_args->array[i]);
}