Merge pull request #12473 from donaldsharp/ensure_used

bgpd: Don't always allocate json memory in non-json path
This commit is contained in:
Donatas Abraitis 2022-12-09 09:17:45 +02:00 committed by GitHub
commit d71f616734
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -775,7 +775,8 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg)
: "");
}
}
json_subgrps = json_object_new_array();
if (ctx->uj)
json_subgrps = json_object_new_array();
UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue;