diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-12-09 09:17:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-09 09:17:45 +0200 |
| commit | d71f6167346bc339e88fb77c8ec1df41b205d16e (patch) | |
| tree | d3cc5df626b2ee121650be2c4232021c05b12a0b | |
| parent | 57968e38a9878a0db0505027b6efc5f851b9d2e2 (diff) | |
| parent | 5691f760d25bbbd31c900b351b86214e83a4874b (diff) | |
Merge pull request #12473 from donaldsharp/ensure_used
bgpd: Don't always allocate json memory in non-json path
| -rw-r--r-- | bgpd/bgp_updgrp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index ee0def29b3..afd2107b48 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -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; |
