bgpd: null check (Coverity 1408766)

Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
paco 2018-06-18 12:51:33 +02:00
parent 6389e663e9
commit e105d90456
No known key found for this signature in database
GPG Key ID: FD112A8C7E6A5E4A

View File

@ -228,15 +228,13 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer,
use_json, json_array);
}
}
if (use_json) {
struct prefix *p;
if (use_json && rm) {
char buf_a[BUFSIZ];
char buf_b[BUFSIZ];
p = &rm->p;
sprintf(buf_a, "%s/%d",
inet_ntop(p->family, &p->u.prefix,
inet_ntop(rm->p.family, rm->p.u.val,
buf_b, BUFSIZ),
p->prefixlen);
rm->p.prefixlen);
json_object_object_add(json_routes, buf_a,
json_array);
}