Null-checking "path->attr" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
json_object *json_ecom_path = NULL;
json_object *json_time_path = NULL;
char timebuf[BGP_UPTIME_LEN];
- struct ecommunity *ipv6_ecomm;
+ struct ecommunity *ipv6_ecomm = NULL;
if (p == NULL || p->family != AF_FLOWSPEC)
return;
if (!path)
return;
- ipv6_ecomm = bgp_attr_get_ipv6_ecommunity(path->attr);
+ if (path->attr)
+ ipv6_ecomm = bgp_attr_get_ipv6_ecommunity(path->attr);
+
if (path->attr && (path->attr->ecommunity || ipv6_ecomm)) {
/* Print attribute */
attr = path->attr;